-
Notifications
You must be signed in to change notification settings - Fork 100
Open
Description
Using exception handling we can make errors catchable by type. If we treat the error as an usual route we can also attach routines to it so it can respect content negotiation (as mentioned on #109).
- Throw
Respect\Rest\Exception\Http\NotFoundexception for404errors instead of just sending a header. - Create a default route to catch this exception, ensuring current behaviour is not affected.
Original issue content
I have a question about how to implement a error route for a Default 404 Not Found Page, but have not found the solution.
I created a class Error404 controller to display a standard html page, but it did not work:
$router->any('/**', 'Routes\Error404');
I also tried to use the method errorRoute, but without success.
$router->errorRoute($callback);
Is there a solution to this problem?
Thank's all to help me!