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

Print Wasm errors in JS console #11644

Merged
merged 1 commit into from
Aug 9, 2022
Merged

Conversation

mitschabaude
Copy link
Contributor

@mitschabaude mitschabaude commented Aug 9, 2022

this uses https://github.com/rustwasm/console_error_panic_hook to make Rust panic log messages with console.error, in Wasm. This makes error messages thrown in Rust much more useful. I checked that it doesn't harm prover performance

@mitschabaude mitschabaude requested review from a team, imeckler and mrmr1993 as code owners August 9, 2022 13:41
@mitschabaude mitschabaude force-pushed the feature/wasm-rust-console branch from 3ca077f to 0394c4d Compare August 9, 2022 13:47
@mitschabaude mitschabaude added the ci-build-me Add this label to trigger a circle+buildkite build for this branch label Aug 9, 2022
@mitschabaude mitschabaude merged commit 7f5261e into develop Aug 9, 2022
@mitschabaude mitschabaude deleted the feature/wasm-rust-console branch August 9, 2022 19:45
@@ -37,6 +37,8 @@ pub fn caml_pasta_fq_plonk_index_create(
prev_challenges: i32,
srs: &WasmSrs,
) -> Result<WasmPastaFqPlonkIndex, JsValue> {
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.

instead should we just set it in an init function as indicated here? https://github.com/rustwasm/console_error_panic_hook#usage

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah sorry, I didn't now how to make an init function that runs at startup, but that would be even cleaner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-build-me Add this label to trigger a circle+buildkite build for this branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants