Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
fix: only capture 500 errors in sentry
- Loading branch information
Showing
with
8 additions
and
4 deletions.
-
+7
−1
src/db/error.rs
-
+1
−3
src/error.rs
|
@@ -65,7 +65,13 @@ impl From<Context<DbErrorKind>> for DbError { |
|
|
_ => StatusCode::INTERNAL_SERVER_ERROR, |
|
|
}; |
|
|
|
|
|
Self { inner, status } |
|
|
let error = Self { inner, status }; |
|
|
|
|
|
if status == StatusCode::INTERNAL_SERVER_ERROR { |
|
|
sentry::integrations::failure::capture_fail(&error); |
|
|
} |
|
|
|
|
|
error |
|
|
} |
|
|
} |
|
|
|
|
|
|
@@ -132,9 +132,7 @@ macro_rules! failure_boilerplate { |
|
|
|
|
|
impl From<$kind> for $error { |
|
|
fn from(kind: $kind) -> Self { |
|
|
let error = Context::new(kind).into(); |
|
|
sentry::integrations::failure::capture_fail(&error); |
|
|
error |
|
|
Context::new(kind).into() |
|
|
} |
|
|
} |
|
|
}; |
|
|