hidstream
hidstream copied to clipboard
Event Emitter cleanup - events during shutdown not handled
While this may be an edge case, if you put a barcode scanner into continuous scan mode, and attempt to scanner.close() as in the example code, you get:
^Cevents.js:183
throw er; // Unhandled 'error' event
^
Error: could not read from HID device
This is problematic on two levels. First, the event emitter cleanup should be explicitly handled, and second, inability to read from the target device, at any stage of operation, should be an explicitly handled error condition.