Enable descriptive HTTP errors to be returned from DB layer
For now, we only use this when redeeming an invite code. Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
parent
d1b7a249b4
commit
3d7e912c6b
5 changed files with 45 additions and 7 deletions
|
@ -88,6 +88,18 @@ impl From<sqlx::Error> for Error {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<axum::Error> for Error {
|
||||
fn from(error: axum::Error) -> Self {
|
||||
Self::Internal(error.into())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<hyper::Error> for Error {
|
||||
fn from(error: hyper::Error) -> Self {
|
||||
Self::Internal(error.into())
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoResponse for Error {
|
||||
fn into_response(self) -> axum::response::Response {
|
||||
match self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue