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

JS bindings: silent errors in callbacks #253

Open
codefrau opened this issue Aug 26, 2023 · 0 comments
Open

JS bindings: silent errors in callbacks #253

codefrau opened this issue Aug 26, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@codefrau
Copy link

The handleError() function in rapier_wasm3d_bg.js eats all errors silently, e.g.

world.forEachRigidBody(rb => { throw Error("foo"); })

That makes it hard to debug. An easy fix would be adding a console.error() line like

function handleError(f, args) {
    try {
        return f.apply(this, args);
    } catch (e) {
        console.error(e);
        wasm.__wbindgen_exn_store(addHeapObject(e));
    }
}

I could not find handleError() in this repo, otherwise I'd have submitted a pull request.

@sebcrozet sebcrozet added enhancement New feature or request good first issue Good for newcomers labels Jan 28, 2024
@sebcrozet sebcrozet transferred this issue from dimforge/rapier Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants