feat(error): add error print info to system command
This commit is contained in:
parent
0d9256793c
commit
be423aabb6
@ -196,14 +196,38 @@ impl AppError {
|
|||||||
AppError::NotFound(s) => s.clone(),
|
AppError::NotFound(s) => s.clone(),
|
||||||
AppError::BadRequest(s) => s.clone(),
|
AppError::BadRequest(s) => s.clone(),
|
||||||
AppError::Forbidden(s) => s.clone(),
|
AppError::Forbidden(s) => s.clone(),
|
||||||
AppError::DatabaseError(_) => "A database error occurred".to_string(),
|
AppError::DatabaseError(s) => {
|
||||||
AppError::PasswordHashError(_) => "A password processing error occurred".to_string(),
|
println!("[System] {:?}", s);
|
||||||
AppError::GitError(_) => "A git operation failed".to_string(),
|
"A database error occurred".to_string()
|
||||||
AppError::SerdeError(_) => "A data parsing error occurred".to_string(),
|
}
|
||||||
AppError::Io(_) => "A file system error occurred".to_string(),
|
AppError::PasswordHashError(s) => {
|
||||||
AppError::InternalServerError(_) => "An internal error occurred".to_string(),
|
println!("[System] {:?}", s);
|
||||||
AppError::AvatarUploadError(_) => "An avatar upload error occurred".to_string(),
|
"A password processing error occurred".to_string()
|
||||||
AppError::Conflict(_) => "Resource conflict".to_string(),
|
}
|
||||||
|
AppError::GitError(s) => {
|
||||||
|
println!("[System] {:?}", s);
|
||||||
|
"A git error occurred".to_string()
|
||||||
|
}
|
||||||
|
AppError::SerdeError(s) => {
|
||||||
|
println!("[System] {:?}", s);
|
||||||
|
"A data parsing error occurred".to_string()
|
||||||
|
}
|
||||||
|
AppError::Io(s) => {
|
||||||
|
println!("[System] {:?}", s);
|
||||||
|
"A file system error occurred".to_string()
|
||||||
|
}
|
||||||
|
AppError::InternalServerError(e) => {
|
||||||
|
println!("[System] {:?}", e);
|
||||||
|
"An internal server error occurred".to_string()
|
||||||
|
}
|
||||||
|
AppError::AvatarUploadError(s) => {
|
||||||
|
println!("[System] {:?}", s);
|
||||||
|
"An avatar upload error occurred".to_string()
|
||||||
|
}
|
||||||
|
AppError::Conflict(s) => {
|
||||||
|
println!("[System] {:?}", s);
|
||||||
|
"Resource conflict".to_string()
|
||||||
|
}
|
||||||
_ => self.slug().to_string(),
|
_ => self.slug().to_string(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user