When things go wrong with an API request, an error message is generated. These error messages contain an error code and a short description of what went wrong with the request. Below is a list of error codes you might encounter when using Crafter CMS and example responses for the corresponding error code:
|Error Code||Description||Response Body Example|
|500||Internal Server Error||
For more details on error codes for specific APIs, please see the ReST API section in the following project specific documentation:
When Crafter Engine detects an error trying to fulfill a request it will also look for a custom error page to display in the browser, the process to add custom error pages is the following:
- Create a new folder under
- Create a Freemarker template using as name the error code for which the page will be displayed, e.g.,
In the custom error templates developers are free to include any HTML/CSS/JS to make sure that the page matches the rest of the site.
Custom Error pages are standalone templates, they are not associated with any site item and will not have
model object available.
A valid context is required for custom error pages to render. If Crafter Engine is not able to load your site context due to a configuration or some other error condition you will receive a default system error page.
Once the file is saved it will be used automatically in preview, for a delivery node you need to publish the new file so that it takes effect in the live site.
Adding a Custom Error Page for the
404 Not Found code: