Skip to content

The event handler fails to print out exception messages #23

Description

@cheery

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions