@@ -2,7 +2,8 @@ use sentry_core::protocol::{Frame, Stacktrace};
2
2
3
3
use crate :: utils:: function_starts_with;
4
4
5
- const WELL_KNOWN_SYS_MODULES : & [ & str ] = & [
5
+ const WELL_KNOWN_NOT_IN_APP : & [ & str ] = & [
6
+ // standard library and sentry crates
6
7
"std::" ,
7
8
"core::" ,
8
9
"alloc::" ,
@@ -13,11 +14,14 @@ const WELL_KNOWN_SYS_MODULES: &[&str] = &[
13
14
// these are not modules but things like __rust_maybe_catch_panic
14
15
"__rust_" ,
15
16
"___rust_" ,
17
+ "rust_begin_unwind" ,
16
18
// these are well-known library frames
17
19
"anyhow::" ,
18
20
"log::" ,
19
21
"tokio::" ,
20
22
"tracing_core::" ,
23
+ "futures_core::" ,
24
+ "futures_util::" ,
21
25
] ;
22
26
23
27
const WELL_KNOWN_BORDER_FRAMES : & [ & str ] = & [
39
43
. iter ( )
40
44
. rev ( )
41
45
. position ( |frame| match frame. function {
42
- Some ( ref func) => is_well_known ( func) || f ( frame, stacktrace) ,
46
+ Some ( ref func) => is_well_known_border_frame ( func) || f ( frame, stacktrace) ,
43
47
None => false ,
44
48
} ) ;
45
49
@@ -49,15 +53,15 @@ where
49
53
}
50
54
}
51
55
52
- /// Checks if a function is considered to be not in-app
53
- pub fn is_sys_function ( func : & str ) -> bool {
54
- WELL_KNOWN_SYS_MODULES
56
+ /// Checks if a function is from a module that shall be considered not in-app by default
57
+ pub fn is_well_known_not_in_app ( func : & str ) -> bool {
58
+ WELL_KNOWN_NOT_IN_APP
55
59
. iter ( )
56
60
. any ( |m| function_starts_with ( func, m) )
57
61
}
58
62
59
- /// Checks if a function is a well-known system function
60
- fn is_well_known ( func : & str ) -> bool {
63
+ /// Checks if a function is a well-known border frame
64
+ fn is_well_known_border_frame ( func : & str ) -> bool {
61
65
WELL_KNOWN_BORDER_FRAMES
62
66
. iter ( )
63
67
. any ( |m| function_starts_with ( func, m) )
0 commit comments