404 page custom handling view

Hi everyone. Can anyone help me, how I can set default 404 error handler page on Adonis JS 4.1 ? If Route not exists, to redirect to views/errors/404.edge page?

Hey @denis! :wave:

You need to create an Error Handler and to listen for the exception E_ROUTE_NOT_FOUND.

Then simply render a view from there. :smile:

1 Like

Thank you very much. I appreciate it