Skip to main content

guard_async_result

Function guard_async_result 

Source
pub async fn guard_async_result<F, R, E>(
    handler_name: &'static str,
    fut: F,
) -> Result<R, E>
where F: Future<Output = Result<R, E>>, R: Default,
Expand description

Run fut that returns Result<R, E> with panic isolation. On panic, log and return Ok(R::default()) so the LSP client gets a graceful empty response (typically null / empty list) instead of seeing the connection closed.