protected function detectErrorAction(\Exception $errors)
{
$error_controller = $this->getErrorController();
if ($errors instanceof HttpNotFoundException) {
return [$error_controller, Controller::ACTION_NOT_FOUND];
} elseif ($errors instanceof HttpMethodNotAllowedException) {
return [$error_controller, Controller::ACTION_METHOD_NOT_ALLOWED];
}
// Do internalError action for any errors.
return [$error_controller, Controller::ACTION_INTERNAL_ERROR];
}