Skip to main content

install_panic_handler

Function install_panic_handler 

Source
pub fn install_panic_handler()
Expand description

Install the custom panic handler.

Linux equivalent: panic_notifier_list

This wraps the default panic handler to:

  1. Generate a crash report
  2. Call the recovery callback (if set) to save state
  3. Log the crash report
  4. Write crash report to file
  5. Call the original panic handler

§Example

use reovim_kernel::panic::{install_panic_handler, set_recovery_callback};

// Set up recovery to save unsaved buffers
set_recovery_callback(Box::new(|info| {
    // Save unsaved buffers...
}));

// Install the handler
install_panic_handler();

§Notes

  • Can only be called once; subsequent calls are no-ops
  • Must be called early in application startup