• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

getdozer / dozer / 5610743655

pending completion
5610743655

push

github

web-flow
feat: Register errors from error manager in jaeger (#1753)

11 of 11 new or added lines in 2 files covered. (100.0%)

42948 of 56422 relevant lines covered (76.12%)

41547.83 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

46.43
/dozer-core/src/error_manager.rs
1
use std::sync::atomic::AtomicU32;
2

3
use dozer_types::tracing::error_span;
4
use dozer_types::{errors::internal::BoxedError, log::error};
5

6
/// `ErrorManager` records and counts the number of errors happened.
7
///
8
/// It panics when an error threshold is set and reached.
×
9
#[derive(Debug)]
×
10
pub struct ErrorManager {
11
    threshold: Option<u32>,
12
    count: AtomicU32,
13
}
14

15
impl ErrorManager {
×
16
    pub fn new_threshold(threshold: u32) -> Self {
383✔
17
        Self {
383✔
18
            threshold: Some(threshold),
383✔
19
            count: AtomicU32::new(0),
383✔
20
        }
383✔
21
    }
383✔
22

×
23
    pub fn new_unlimited() -> Self {
×
24
        Self {
×
25
            threshold: None,
×
26
            count: AtomicU32::new(0),
×
27
        }
×
28
    }
×
29

×
30
    pub fn report(&self, error: BoxedError) {
3✔
31
        error_span!("reported error", error = true, e = error);
3✔
32
        error!("{}", error);
3✔
33

×
34
        let count = self.count.fetch_add(1, std::sync::atomic::Ordering::SeqCst);
3✔
35
        if let Some(threshold) = self.threshold {
3✔
36
            if count >= threshold {
3✔
37
                panic!("Error threshold reached: {}", threshold);
3✔
38
            }
×
39
        }
×
40
    }
×
41
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc