(&self)
| 23 | |
| 24 | impl 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 | |
| 41 | pub fn create_bank( |
nothing calls this directly
no outgoing calls
no test coverage detected