Skip to content

Commit 5b36494

Browse files
committed
Replace PanicInfo with PanicInfoHook
1 parent c9a120e commit 5b36494

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/crates_io_worker/src/util.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use anyhow::anyhow;
22
use sentry_core::Hub;
33
use std::any::Any;
44
use std::future::Future;
5-
use std::panic::PanicInfo;
5+
use std::panic::PanicHookInfo;
66

77
pub async fn with_sentry_transaction<F, R, E, Fut>(
88
transaction_name: &str,
@@ -34,11 +34,11 @@ where
3434
/// Try to figure out what's in the box, and print it if we can.
3535
///
3636
/// The actual error type we will get from `panic::catch_unwind` is really poorly documented.
37-
/// However, the `panic::set_hook` functions deal with a `PanicInfo` type, and its payload is
37+
/// However, the `panic::set_hook` functions deal with a `PanicHookInfo` type, and its payload is
3838
/// documented as "commonly but not always `&'static str` or `String`". So we can try all of those,
3939
/// and give up if we didn't get one of those three types.
4040
pub fn try_to_extract_panic_info(info: &(dyn Any + Send + 'static)) -> anyhow::Error {
41-
if let Some(x) = info.downcast_ref::<PanicInfo<'_>>() {
41+
if let Some(x) = info.downcast_ref::<PanicHookInfo<'_>>() {
4242
anyhow!("job panicked: {x}")
4343
} else if let Some(x) = info.downcast_ref::<&'static str>() {
4444
anyhow!("job panicked: {x}")

0 commit comments

Comments
 (0)