8
8
//! # Configuration
9
9
//!
10
10
//! The panic integration can be configured with an additional extractor, which
11
- //! might optionally create a sentry `Event` out of a `PanicInfo `.
11
+ //! might optionally create a sentry `Event` out of a `PanicHookInfo `.
12
12
//!
13
13
//! ```
14
14
//! let integration = sentry_panic::PanicIntegration::default().add_extractor(|info| None);
19
19
#![ warn( missing_docs) ]
20
20
#![ deny( unsafe_code) ]
21
21
22
- use std:: panic:: { self , PanicInfo } ;
22
+ use std:: panic:: { self , PanicHookInfo } ;
23
23
use std:: sync:: Once ;
24
24
25
25
use sentry_backtrace:: current_stacktrace;
@@ -31,7 +31,7 @@ use sentry_core::{ClientOptions, Integration};
31
31
/// This panic handler reports panics to Sentry. It also attempts to prevent
32
32
/// double faults in some cases where it's known to be unsafe to invoke the
33
33
/// Sentry panic handler.
34
- pub fn panic_handler ( info : & PanicInfo < ' _ > ) {
34
+ pub fn panic_handler ( info : & PanicHookInfo < ' _ > ) {
35
35
sentry_core:: with_integration ( |integration : & PanicIntegration , hub| {
36
36
hub. capture_event ( integration. event_from_panic_info ( info) ) ;
37
37
if let Some ( client) = hub. client ( ) {
@@ -40,7 +40,7 @@ pub fn panic_handler(info: &PanicInfo<'_>) {
40
40
} ) ;
41
41
}
42
42
43
- type PanicExtractor = dyn Fn ( & PanicInfo < ' _ > ) -> Option < Event < ' static > > + Send + Sync ;
43
+ type PanicExtractor = dyn Fn ( & PanicHookInfo < ' _ > ) -> Option < Event < ' static > > + Send + Sync ;
44
44
45
45
/// The Sentry Panic handler Integration.
46
46
#[ derive( Default ) ]
@@ -75,7 +75,7 @@ impl Integration for PanicIntegration {
75
75
}
76
76
77
77
/// Extract the message of a panic.
78
- pub fn message_from_panic_info < ' a > ( info : & ' a PanicInfo < ' _ > ) -> & ' a str {
78
+ pub fn message_from_panic_info < ' a > ( info : & ' a PanicHookInfo < ' _ > ) -> & ' a str {
79
79
match info. payload ( ) . downcast_ref :: < & ' static str > ( ) {
80
80
Some ( s) => s,
81
81
None => match info. payload ( ) . downcast_ref :: < String > ( ) {
@@ -95,7 +95,7 @@ impl PanicIntegration {
95
95
#[ must_use]
96
96
pub fn add_extractor < F > ( mut self , f : F ) -> Self
97
97
where
98
- F : Fn ( & PanicInfo < ' _ > ) -> Option < Event < ' static > > + Send + Sync + ' static ,
98
+ F : Fn ( & PanicHookInfo < ' _ > ) -> Option < Event < ' static > > + Send + Sync + ' static ,
99
99
{
100
100
self . extractors . push ( Box :: new ( f) ) ;
101
101
self
@@ -104,7 +104,7 @@ impl PanicIntegration {
104
104
/// Creates an event from the given panic info.
105
105
///
106
106
/// The stacktrace is calculated from the current frame.
107
- pub fn event_from_panic_info ( & self , info : & PanicInfo < ' _ > ) -> Event < ' static > {
107
+ pub fn event_from_panic_info ( & self , info : & PanicHookInfo < ' _ > ) -> Event < ' static > {
108
108
for extractor in & self . extractors {
109
109
if let Some ( event) = extractor ( info) {
110
110
return event;
0 commit comments