Hello every1!
So, the problem is - How do I handle 500 error on phalcon. I mean - I got clear, how to handle not found errors
Code:
$eventsManager->attach( 'dispatch:beforeException', function($event, $dispatcher, $exception){ switch ($exception->getCode()){ case Dispatcher::EXCEPTION_HANDLER_NOT_FOUND: case Dispatcher::EXCEPTION_ACTION_NOT_FOUND: $dispatcher->forward( array( 'controller' => 'error', 'action' => 'notFound', ) ); return false; break;
default:
$dispatcher->forward(
array(
'controller' => 'error',
'action' => 'uncaughtException',
)
);
return false;
break;
}
}
);
But the part with 500 error is not working. Any suggestions?