Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: inject console_error_panic_hook into constructors of Workbook and Worksheet #38

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kenkoooo
Copy link
Member

To show detailed error messages in the browser's console view, console_error_panic_hook is injected into the constructors of Workbook and Worksheet. Additionally, a redundant function has been removed.

@kenkoooo kenkoooo requested review from tamaroning and rajyan January 10, 2025 06:36
@@ -34,6 +34,7 @@ impl Workbook {
/// TODO: example omitted
#[wasm_bindgen(constructor)]
pub fn new() -> Self {
console_error_panic_hook::set_once();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you think of calling std::panic_set_hook in the default export (xlsxInit) instead?

std::panic::set_hook(Box::new(console_error_panic_hook::hook));

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I'll do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants