Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Disable setting panic hook #144

Open
ten3roberts opened this issue Nov 28, 2023 · 2 comments
Open

Disable setting panic hook #144

ten3roberts opened this issue Nov 28, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@ten3roberts
Copy link
Contributor

ten3roberts commented Nov 28, 2023

Add an option for the builder to disable the setting the panic hook, and only setting the eyre hook.

This is useful for targeting the web where you may already use console_error_panic_hook

@ten3roberts ten3roberts added the enhancement New feature or request label Nov 28, 2023
@ten3roberts
Copy link
Contributor Author

Workaround:

let (_, eyre_hook) = color_eyre::config::HookBuilder::default().into_hooks();
eyre_hook.install().unwrap();

@MolotovCherry
Copy link

MolotovCherry commented Feb 22, 2024

I was encountering an issue with their tracing example, cause I had other error handlers initiated. This helped me, since I wanted to only enable the panic hook but not the error hook. Same principle above, except .0 instead of .1. Thanks!

Edit: Figured out the issue, for some reason using eyre (eyre!() and Result) before setting the hooks somehow caused a hook to get set, even though I never set it. That caused the error hook to error out as it was already "set"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants