public function detectNotFoundError(MvcEvent $e)
{
$error = $e->getError();
if (empty($error)) {
return;
}
switch ($error) {
case Application::ERROR_CONTROLLER_NOT_FOUND:
case Application::ERROR_CONTROLLER_INVALID:
case Application::ERROR_ROUTER_NO_MATCH:
$this->reason = $error;
$response = $e->getResponse();
if (!$response) {
$response = new HttpResponse();
$e->setResponse($response);
}
$response->setStatusCode(404);
break;
default:
return;
}
}