Version: v0.7.1 - Beta.  We welcome contributors & feedback.

Output.sendError

Output.sendError($errorCode, $title='', $descriptionHtml='') -> false

Description

Return an error page with the HTTP $errorCode (usually 40X or 500).

$title will usually default to “Website Error”.

$descriptionHtml can be used to provide further details and must be an HTML TypeString. Be careful about what you reveal here.

// 400 Bad Request
Output.sendError(400)

// 403 Forbidden
Output.sendError(403)

// 404 Page Not Found
Output.sendError(404)

// 500 Server Error
Output.sendError(500, 'Something Went Wrong')

Custom Route

If you have a route mapped to the errorCode, that route will be run instead of the default THT error page.

routes: {
    404:  /missing
}

See Also