8764: internal: add rust-analyzer version to panic context r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2021-05-08 11:14:24 +00:00 committed by GitHub
commit 4e3f0186d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,12 @@ impl<'a> RequestDispatcher<'a> {
let world = panic::AssertUnwindSafe(&mut *self.global_state);
let response = panic::catch_unwind(move || {
let _pctx = stdx::panic_context::enter(format!("request: {} {:#?}", R::METHOD, params));
let _pctx = stdx::panic_context::enter(format!(
"\nversion: {}\nrequest: {} {:#?}",
env!("REV"),
R::METHOD,
params
));
let result = f(world.0, params);
result_to_response::<R>(id, result)
})
@ -61,8 +66,12 @@ impl<'a> RequestDispatcher<'a> {
let world = self.global_state.snapshot();
move || {
let _pctx =
stdx::panic_context::enter(format!("request: {} {:#?}", R::METHOD, params));
let _pctx = stdx::panic_context::enter(format!(
"\nversion: {}\nrequest: {} {:#?}",
env!("REV"),
R::METHOD,
params
));
let result = f(world, params);
Task::Response(result_to_response::<R>(id, result))
}
@ -166,7 +175,11 @@ impl<'a> NotificationDispatcher<'a> {
return Ok(self);
}
};
let _pctx = stdx::panic_context::enter(format!("notification: {}", N::METHOD));
let _pctx = stdx::panic_context::enter(format!(
"\nversion: {}\nnotification: {}",
env!("REV"),
N::METHOD
));
f(self.global_state, params)?;
Ok(self)
}