This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

Alexandre
Alexandre

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

jeremymouton
jeremymouton

For 404 pages, I use:

title = "404"
url = "/404"
layout = "default"
==
<h1>404</h1>
<p>This page has moved or no longer exists.</p>

You may be able to do the same for 500 Error pages. I personally only use 404 and a default Error page.

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.