Browse Source

Improve docs for set_panic_hook

pull/162/head
Fenrir 10 months ago
parent
commit
ffbe6604a6
  1. 12
      ctru-rs/src/applets/error.rs

12
ctru-rs/src/applets/error.rs

@ -88,12 +88,16 @@ impl PopUp {
} }
} }
/// Sets a custom panic hook that uses the error applet to display panic messages. You can also choose to have the /// Sets a custom [panic hook](https://doc.rust-lang.org/std/panic/fn.set_hook.html) that uses the error applet to display panic messages.
/// previously registered panic hook called along with the error applet message, which can be useful if you want
/// to use input redirection to display panic messages over `3dslink` or `GDB`.
/// ///
/// If the `Gfx` service is not initialized during a panic, the error applet will not be displayed and the old /// You can also choose to have the previously registered panic hook called along with the error applet message, which can be useful
/// if you want to use output redirection to display panic messages over `3dslink` or `GDB`.
///
/// If the [`Gfx`] service is not initialized during a panic, the error applet will not be displayed and the old
/// panic hook will be called. /// panic hook will be called.
///
/// You can use [`std::panic::take_hook`](https://doc.rust-lang.org/std/panic/fn.take_hook.html) to unregister the panic hook
/// set by this function.
pub fn set_panic_hook(call_old_hook: bool) { pub fn set_panic_hook(call_old_hook: bool) {
use crate::services::gfx::GFX_ACTIVE; use crate::services::gfx::GFX_ACTIVE;
use std::sync::TryLockError; use std::sync::TryLockError;

Loading…
Cancel
Save