The most common errors seen in Ghost are
404 errors. Depending on the complexity of your theme, your routes file and other factors, errors can range from 4xx to 5xx. Read more about error status codes on MDN.
Routes
Errors can be rendered on any route.Templates
The default template for an error iserror.hbs, this will be used to render any error if there are no specific templates provided.
Error classes, 4xx and 5xx can be captured using error-4xx.hbs and error-5xx.hbs respectively. For example a 404 error can be captured with error-4xx.hbs, and a 500 error can be captured with error-5xx.hbs.
Specific errors can be captured by naming the template with the status code. For example 404 errors can be captured using error-404.hbs.
If no custom error templates have been defined in the theme Ghost will use it’s default error template.
Data
Error templates have access to the details of the error and the following attributes can be used:Error object attributes
-
{{statusCode}}— The HTTP status code of the error -
{{message}}— The error message -
{{errorDetails}}— An object containing further error details{{rule}}— The rule{{ref}}— A reference{{message}}— Further information about the issue captured
Helpers
Error templates shouldn’t use any theme helpers, with the exception of{{asset}}, or extend the default template, to further avoid the use of template helpers. Using theme helpers inside error templates can lead to misleading error reports.
The only error template that is permitted to use helpers is the error-404.hbs template file.

