Permalink
Browse files

fix: only capture 500 errors in sentry

  • Loading branch information...
philbooth committed Nov 21, 2018
1 parent b12b07f commit b2935f581676cf9be4627cc6eeed278b7175a9a1
Showing with 8 additions and 4 deletions.
  1. +7 −1 src/db/error.rs
  2. +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()
}
}
};

0 comments on commit b2935f5

Please sign in to comment.