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

The event handler fails to print out exception messages #23

Open
cheery opened this issue Jun 9, 2017 · 0 comments
Open

The event handler fails to print out exception messages #23

cheery opened this issue Jun 9, 2017 · 0 comments

Comments

@cheery
Copy link
Owner

cheery commented Jun 9, 2017

In a related pull request, we may have spotted a bug. The bug causes the exceptions to be ignored silently inside the event handler.

To illustrate the problem, here's an example:

var util = require("util");
var udev = require("./udev.js");

var monitor = udev.monitor();
monitor.on('add', function (device) {
    console.log(device.DEVPATH + " added");
    throw new Error("Trycatch?");
});

The above example should result in an error logged, similar to the following program:

setTimeout(function(){
    console.log("timeout");
    throw new Error("Trycatch?");
}, 1);

There should be a handler in Node.js runtime that implements the behavior, it should be added into on_handle_event to resolve this issue.

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

No branches or pull requests

1 participant