Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device Missing #1

Open
markwallsgrove opened this issue Mar 29, 2017 · 1 comment
Open

Device Missing #1

markwallsgrove opened this issue Mar 29, 2017 · 1 comment

Comments

@markwallsgrove
Copy link

usb.findByIds will return undefined if the device is not plugged in. The second line in the snippet below causes a error to be thrown TypeError: Cannot read property 'open' of undefined.

    device = usb.findByIds(this.vid, this.pid);
    device.open();

Would it be possible it either return a error to the callback or throw a exception? If you could state your preference I don't mind raising a PR.

@dave-irvine
Copy link
Owner

@markwallsgrove Sorry for some reason I never got notified about this issue.

I'd prefer to return an error to the callback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants