protected function getErrorFlashMessage()
{
if ($this->arguments->getValidationResults()->hasErrors()) {
return false;
}
$errorMessage = 'An error occurred';
if ($this->objectManager->getContext()->isDevelopment()) {
$errorMessage .= ' while trying to call %1$s->%2$s()';
}
return new Error($errorMessage, null, [get_class($this), $this->actionMethodName]);
}