Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

fix(sentry): stop passing 4xx errors to Sentry #245

Merged
merged 1 commit into from
Nov 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/types/error/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,16 @@ impl Fail for AppError {

impl From<AppErrorKind> for AppError {
fn from(kind: AppErrorKind) -> AppError {
let capture_in_sentry = kind.http_status() == Status::InternalServerError;

let error = AppError {
inner: Context::new(kind).into(),
};
sentry::integrations::failure::capture_fail(&error);

if capture_in_sentry {
sentry::integrations::failure::capture_fail(&error);
}

error
}
}
Expand Down