chatgpt-panic-hook 0.1.2

A panic hook that asks ChatGPT what went wrong
Documentation

chatgpt-panic-hook

Crates.io Documentation MSRV License

The last panic hook you will ever need.

When your Rust program panics, chatgpt-panic-hook preserves the normal panic output and opens ChatGPT in your default browser with the panic message and source location:

fn main() {
    chatgpt_panic_hook::install();

    panic!("borrow checker escaped");
}

Add it to your project:

cargo add chatgpt-panic-hook

That is the entire API. Calling install more than once has no additional effect.

From a repository checkout, run the example:

cargo run --example panic

The command intentionally panics and opens ChatGPT in the default browser.

Privacy

This crate sends panic messages and source paths to chatgpt.com as a URL query parameter. Those values can contain secrets, private user data, or details about your machine. Use it for local experiments, not production.

Origin

Inspired by the JavaScript error-handling strategy:

try {
    // ...
} catch (error) {
    window.location.href = `https://chatgpt.com/?q=${error}`;
}

Rust does not have try/catch, but it does have panic hooks.

License

MIT