chore: fix formatting and clippy lints
This commit is contained in:
1 parent
8952bd5399
commit
9d9e959744
35 files changed
+1091
-582
No files matched your search
+13
-3
@@ -17,7 +17,11 @@ pub enum AppError {
|
||||
EntityNotFound { name: String, namespace: String },
|
||||
|
||||
#[error("Invalid relation between '{from}' and '{to}': {reason}")]
|
||||
InvalidRelation { from: String, to: String, reason: String },
|
||||
InvalidRelation {
|
||||
from: String,
|
||||
to: String,
|
||||
reason: String,
|
||||
},
|
||||
|
||||
#[error("Database error for key '{key}': {message}")]
|
||||
DatabaseError { key: String, message: String },
|
||||
@@ -50,11 +54,17 @@ impl IntoResponse for AppError {
|
||||
AppError::NotFound(msg) => (StatusCode::NOT_FOUND, msg.clone()),
|
||||
AppError::EntityNotFound { name, namespace } => (
|
||||
StatusCode::NOT_FOUND,
|
||||
format!("Entity '{}' was not found in namespace '{}'", name, namespace),
|
||||
format!(
|
||||
"Entity '{}' was not found in namespace '{}'",
|
||||
name, namespace
|
||||
),
|
||||
),
|
||||
AppError::InvalidRelation { from, to, reason } => (
|
||||
StatusCode::BAD_REQUEST,
|
||||
format!("Invalid relation between '{}' and '{}': {}", from, to, reason),
|
||||
format!(
|
||||
"Invalid relation between '{}' and '{}': {}",
|
||||
from, to, reason
|
||||
),
|
||||
),
|
||||
AppError::DatabaseError { key, message } => (
|
||||
StatusCode::INTERNAL_SERVER_ERROR,
|
||||
|
||||
Reference in new issue
Block a user