Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 25, 2025. It is now read-only.
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Customize error message reporting #28

Open
Labels
enhancementNew feature or request
@ten3roberts

Description

Motivation

Currently, errors are logged to the console using console.error. However, it would be useful to provide your own callback for the message, which would allow for using tracing::error instead, which would also enable panics to show in wasm-pack test --node, as well as making it possible for providing your own error screens

Proposed Solution

Provide a new setup function which takes a closure to invoke with the error message, and make the existing set_once use this internally by falling back to console.error

console_error_panic_hook::set_once_with(|msg| tracing::error!("{msg}"));

Alternatives

Making a custom panic hook in place which will contain almost all of this crate's logic, as I have currently done to enable this to work with wasm-pack test and non console environments

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /