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

Function error_handlers

templating/handlebars/src/main.rs:71–73  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

69
70// Custom error handlers, to return HTML responses when an error occurs.
71fn error_handlers() -> ErrorHandlers<BoxBody> {
72 ErrorHandlers::new().handler(StatusCode::NOT_FOUND, not_found)
73}
74
75// Error handler for a 404 Page not found error.
76fn not_found<B>(res: ServiceResponse<B>) -> Result<ErrorHandlerResponse<BoxBody>> {

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected