Closed edabe closed 2 weeks ago
Hello edabe,
Thank you for finding and reporting a bug. I'll take a look at it and fix it.
Best regards, Benjamin
The bug has been fixed, if it works for you too, then the issue can be closed.
Happy coding!
Best regards, Benjamin
Hello Benjamin, Thank you for such a quick turnaround.
Yes, I tried the fix locally and it worked fine!
Hello Benjamin, While prototyping with your lib, I ran into an error and there might be a simple fix.
Describe the bug If
GarminStick3.open()
throws an exception, the app will crash with a huge print-out of the entireindex.cjs
followed by:This is likely because of a bug in
node-usb
where theLibUSBException
does not properly declares a custom Error class (prototype chain not properly set)To Reproduce
Expected behavior The second app should fail gracefully indicating why the connection to the ANT+ stick failed.
Screenshots N/A
Environment (please complete the following information):
Additional context N/!
Proposed fix This seems to be the recommended way to handle
LibUSBException
errors: https://github.com/node-usb/node-usb/blob/15781f02baa1f6c856a8d03968de9abd64c4f880/tsc/usb/device.ts#L34Based on that: