Skip to content

Commit

Permalink
refactor: Remove middleware::sentry::queue_report (#1040)
Browse files Browse the repository at this point in the history
Closes: #1021
  • Loading branch information
ethowitz authored Apr 9, 2021
1 parent 0e6725f commit 0dccb00
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions src/web/middleware/sentry.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
use std::task::Context;
use std::{
cell::{RefCell, RefMut},
rc::Rc,
};
use std::{cell::RefCell, rc::Rc};

use actix_http::Extensions;
use actix_web::{
dev::{Service, ServiceRequest, ServiceResponse, Transform},
web::Data,
Expand Down Expand Up @@ -57,23 +53,6 @@ pub struct SentryWrapperMiddleware<S> {
service: Rc<RefCell<S>>,
}

pub fn queue_report(mut ext: RefMut<'_, Extensions>, err: &Error) {
let apie: Option<&ApiError> = err.as_error();
if let Some(apie) = apie {
if !apie.is_reportable() {
trace!("Sentry Not reporting error: {:?}", err);
return;
}
let event = sentry::integrations::failure::event_from_fail(apie);
if let Some(events) = ext.get_mut::<Vec<Event<'static>>>() {
events.push(event);
} else {
let events: Vec<Event<'static>> = vec![event];
ext.insert(events);
}
}
}

pub fn report(tags: &Tags, mut event: Event<'static>) {
let tags = tags.clone();
event.tags = tags.clone().tag_tree();
Expand Down

0 comments on commit 0dccb00

Please sign in to comment.