Documentation › Traditional web application › Custom error pages
If you select the Custom error pages option when generating your codebase, the error handling helper functions in cmd/web/errors.go will be configured to render the custom error templates in the assets/templates/pages/errors directory, instead of writing a plaintext error message.
Specifically:
serverError() helper renders the pages/errors/500.tmpl template.notFound() helper renders the pages/errors/404.tmpl template.badRequest() helper renders the pages/errors/400.tmpl template.If you selected the Basic auth option when generating your codebase, the basicAuthenticationRequired() helper will also render the pages/errors/401.tmpl template.
Feel free to customize the template files as you wish.