Skip to content

Commit

Permalink
Improve docs for set_panic_hook
Browse files Browse the repository at this point in the history
  • Loading branch information
FenrirWolf committed Feb 26, 2024
1 parent 6da884e commit 8c7d406
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ctru-rs/src/applets/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
/// 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`.
/// 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.
///
/// 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 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
/// panic hook will be called.
///
/// You can use [`std::panic::take_hook`](https://doc.rust-lang.org/std/panic/fn.take_hook.html) unregister the panic hook
/// set by this function.
pub fn set_panic_hook(call_old_hook: bool) {
use crate::services::gfx::GFX_ACTIVE;
use std::sync::TryLockError;
Expand Down

0 comments on commit 8c7d406

Please sign in to comment.