Error templates used for all 4xx
and 5xx
errors that may arise on a site
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.
error.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.
{{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{{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.