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

Method error_response

databases/postgres/src/errors.rs:16–24  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

14
15impl ResponseError for MyError {
16 fn error_response(&self) -> HttpResponse {
17 match *self {
18 MyError::NotFound => HttpResponse::NotFound().finish(),
19 MyError::PoolError(ref err) => {
20 HttpResponse::InternalServerError().body(err.to_string())
21 }
22 _ => HttpResponse::InternalServerError().finish(),
23 }
24 }
25}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected