MCPcopy Create free account
hub / github.com/actix/examples / error_handlers

Function error_handlers

templating/tera/src/main.rs:55–57  ·  view source on GitHub ↗

Custom error handlers, to return HTML responses when an error occurs.

()

Source from the content-addressed store, hash-verified

53
54// Custom error handlers, to return HTML responses when an error occurs.
55fn error_handlers() -> ErrorHandlers<BoxBody> {
56 ErrorHandlers::new().handler(StatusCode::NOT_FOUND, not_found)
57}
58
59// Error handler for a 404 Page not found error.
60fn not_found<B>(res: ServiceResponse<B>) -> Result<ErrorHandlerResponse<BoxBody>> {

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected