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

getdozer / dozer / 6299724219

25 Sep 2023 12:58PM UTC coverage: 77.81% (+0.5%) from 77.275%
6299724219

push

github

chubei
fix: Add `BINDGEN_EXTRA_CLANG_ARGS` to cross compile rocksdb

50223 of 64546 relevant lines covered (77.81%)

148909.49 hits per line

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

58.33
/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 {
629✔
17
        Self {
629✔
18
            threshold: Some(threshold),
629✔
19
            count: AtomicU32::new(0),
629✔
20
        }
629✔
21
    }
629✔
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
        let err_span = error_span!("reported error", error = true, e = error);
3✔
32
        let _error_guard = err_span.enter();
3✔
33
        error!("{}", error);
3✔
34

35
        let count = self.count.fetch_add(1, std::sync::atomic::Ordering::SeqCst);
3✔
36
        if let Some(threshold) = self.threshold {
3✔
37
            if count >= threshold {
3✔
38
                panic!("Error threshold reached: {}", threshold);
3✔
39
            }
×
40
        }
×
41
    }
×
42
}
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