NotFound extension

Extension on HttpRequest to send a 404 response.

The framework first attempts to render the errors.404 template. If the template is unavailable or rendering fails, it falls back to a plain-text 404 Not Found response.

Example:

return request.notFound();
on

Methods

notFound() Future<HttpResponse>

Available on HttpRequest, provided by the NotFound extension

Renders errors.404 or falls back to a plain 404 response.