Skip to content

Commit

Permalink
fixup! editoast: define Model error type and use it in trait Delete
Browse files Browse the repository at this point in the history
Signed-off-by: Leo Valais <leo.valais97@gmail.com>
  • Loading branch information
leovalais committed Jan 10, 2025
1 parent 2d7acaa commit a15b78c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions editoast/editoast_models/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ impl From<diesel::result::Error> for Error {
constraint: captures.get(1).unwrap().as_str().to_string(),
}
} else {
// falling back to the generic error — since it's still semantically correct, logging the error is enough
tracing::error!(?RE, %e, "failed to parse PostgreSQL error message");
Self::DatabaseError(e.into())
}
Expand All @@ -48,6 +49,7 @@ impl From<diesel::result::Error> for Error {
constraint: captures.get(2).unwrap().as_str().to_string(),
}
} else {
// falling back to the generic error — since it's still semantically correct, logging the error is enough
tracing::error!(?RE, %e, "failed to parse PostgreSQL error message");
Self::DatabaseError(e.into())
}
Expand Down

0 comments on commit a15b78c

Please sign in to comment.