Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Error pages

From MoodleDocs

There is a variety of way different errors can happen in Moodle. Because they each happen under different circumstance there cannot be a single way of handling them, and where possible and desirable to customize them.


Normal Moodle errors

These types of errors are things like you tried to access a course which no longer exists, or access a course which you don't have access to. Because these are "Moodle" pages they are themed correctly and normally there isn't much you want to do to improve them.

If you want to change the wording of the errors see:

https://docs.moodle.org/en/Language_customisation

If you want to change the theme, that is one and the same as normal theme customization:

https://docs.moodle.org/dev/Themes_overview

Fatal Moodle errors

These types of errors are more fundamental, and something has gone wrong so Moodle itself can't load, which means the error page can't access the database, MUC, or the language and strings API.

These are difficult to style, and there are many edge cases to capture. This should get fixed in this tracker:

https://tracker.moodle.org/browse/MDL-56041

Web server errors

These are for errors which are technically outside of moodle such a 404 file not found at the server level rather than a 404 served by moodle. If you want to theme these the same as you normally would for anything non Moodle, but there is another option to send 404's to a Moodle themed php page so it gets the theming for free. You can see an example of what this error page looks like here:

https://moodle.org/errors/

Apache

You can configure this using:

ErrorDocument 404 /error/index.php

nginx

tba

Maintenance mode

During maintenance mode Moodle will serve a "503 Service Unavailable". This page can be customized

https://docs.moodle.org/38/en/Maintenance_mode#CLI_maintenance_mode