};
let world = panic::AssertUnwindSafe(&mut *self.global_state);
let response = panic::catch_unwind(move || {
- stdx::panic_context::enter(format!("request: {} {:#?}", R::METHOD, params));
+ let _pctx = stdx::panic_context::enter(format!("request: {} {:#?}", R::METHOD, params));
let result = f(world.0, params);
result_to_response::<R>(id, result)
})
let world = self.global_state.snapshot();
move || {
- let _ctx =
+ let _pctx =
stdx::panic_context::enter(format!("request: {} {:#?}", R::METHOD, params));
let result = f(world, params);
Task::Response(result_to_response::<R>(id, result))
return Ok(self);
}
};
- stdx::panic_context::enter(format!("notification: {}", N::METHOD));
+ let _pctx = stdx::panic_context::enter(format!("notification: {}", N::METHOD));
f(self.global_state, params)?;
Ok(self)
}
use std::{cell::RefCell, panic, sync::Once};
-pub fn enter(context: String) -> impl Drop {
+pub fn enter(context: String) -> PanicContext {
static ONCE: Once = Once::new();
ONCE.call_once(PanicContext::init);
}
#[must_use]
-struct PanicContext {
+pub struct PanicContext {
_priv: (),
}