Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Commit

Permalink
Handle command errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Julius de Bruijn committed Aug 15, 2023
1 parent 80c1055 commit 4a0b217
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ impl From<mongodb::error::Error> for Error {

Self::BadRequest(value)
}
ErrorKind::Command(error) => {
let value = json!({ "error": error.message, "error_code": "InvalidArgument", "link": "string" });

Self::BadRequest(value)
}
ErrorKind::Authentication { message, .. } => {
let value =
json!({ "error": message, "error_code": "InvalidSession", "link": "string" });
Expand Down

0 comments on commit 4a0b217

Please sign in to comment.