hidstream icon indicating copy to clipboard operation
hidstream copied to clipboard

Event Emitter cleanup - events during shutdown not handled

Open hillct opened this issue 8 years ago • 0 comments

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.

hillct avatar Dec 16 '17 18:12 hillct