With debug in mode false the system renders \error page by default.
The problem is cause I can't show a custom message for the specific error.
For example, this is the content of my error page:
url = '/error'
==
ops, error!
In my middleware, if using App::abort(404) or App::abort(500) the message will always be the same: ops, error!
I wish something like this was possible:
url = '/error'
==
{% if statusCode == 500 %}
server error!
{% else if statusCode == 404 %}
page not found!
{% endif %}
Or, pages for each status code: \error\404 and \error\500.
How i can filter the status code and show a custom message in \error page?
Last updated