node-dualshock-controller icon indicating copy to clipboard operation
node-dualshock-controller copied to clipboard

unhandled error when controller is not present

Open TheRockyOng opened this issue 10 years ago • 3 comments

currently exception is not handled. need to present with human readable error message as well

TheRockyOng avatar Apr 30 '14 05:04 TheRockyOng

I have the same error. Is there something to do to avoid it?

fruityfred avatar Apr 12 '15 21:04 fruityfred

Adding an error handler in linuxConnector.js prevents the exception from being thrown, and the application keeps on running ;)

After this (around line 75):

controller = new joystick(0, 3500, 350);

add:

controller.on('error', function (err) {
    console.log("Joystick error: ", err);
});

fruityfred avatar Apr 12 '15 21:04 fruityfred

nice, will include.

rdepena avatar Apr 13 '15 13:04 rdepena