use std::{
panic,
process::exit,
};
pub(crate) fn use_custom_panic_hook() {
let hook = panic::take_hook();
panic::set_hook(Box::new(move |panic_info| {
let panic_message = panic_info.to_string();
if panic_message.contains("Broken pipe") || panic_message.contains("os error 32") {
exit(0);
}
(hook)(panic_info);
}));
}