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

Method status_code

databases/mysql/src/persistence.rs:25–38  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

23
24impl actix_web::ResponseError for PersistenceError {
25 fn status_code(&self) -> StatusCode {
26 match self {
27 PersistenceError::EmptyBankName
28 | PersistenceError::EmptyCountry
29 | PersistenceError::EmptyBranch
30 | PersistenceError::EmptyLocation
31 | PersistenceError::EmptyTellerName
32 | PersistenceError::EmptyCustomerName => StatusCode::BAD_REQUEST,
33
34 PersistenceError::MysqlError(_) | PersistenceError::Unknown => {
35 StatusCode::INTERNAL_SERVER_ERROR
36 }
37 }
38 }
39}
40
41pub fn create_bank(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected