v0.8.0
This commit is contained in:
@@ -8,6 +8,8 @@ pub enum AppError {
|
||||
NotFound(String),
|
||||
#[error("invalid request: {0}")]
|
||||
BadRequest(String),
|
||||
#[error("conflict: {0}")]
|
||||
Conflict(String),
|
||||
#[error("unauthorized")]
|
||||
Unauthorized,
|
||||
#[error("device communication failed: {0}")]
|
||||
@@ -21,6 +23,7 @@ impl IntoResponse for AppError {
|
||||
let (status, message) = match &self {
|
||||
Self::NotFound(v) => (StatusCode::NOT_FOUND, v.clone()),
|
||||
Self::BadRequest(v) => (StatusCode::BAD_REQUEST, v.clone()),
|
||||
Self::Conflict(v) => (StatusCode::CONFLICT, v.clone()),
|
||||
Self::Unauthorized => (StatusCode::UNAUTHORIZED, "unauthorized".into()),
|
||||
Self::Device(v) => (StatusCode::BAD_GATEWAY, v.clone()),
|
||||
Self::Internal(v) => {
|
||||
|
||||
Reference in New Issue
Block a user