Skip to content

Include hidapi error message on open failrues#68

Merged
apmorton merged 1 commit intoapmorton:masterfrom
legonigel:patch-1
Feb 5, 2026
Merged

Include hidapi error message on open failrues#68
apmorton merged 1 commit intoapmorton:masterfrom
legonigel:patch-1

Conversation

@legonigel
Copy link
Contributor

HIDAPI has an error message for open failures, which this appends to the existing unable to open message.

I tested this locally without building just through a simple command line:

>>> import hid
>>> dev = hid.Device(vid=0x0d8c, pid=0x000c)
Traceback (most recent call last):
  File "<python-input-1>", line 1, in <module>
    dev = hid.Device(vid=0x0d8c, pid=0x000c)
  File "/home/nigel/aioc-util/venv/lib/python3.13/site-packages/hid/__init__.py", line 177, in __init__
    raise HIDException('unable to open device')
hid.HIDException: unable to open device
>>> print(hid.hidapi.hid_error(0))
No HID devices with requested VID/PID found in the system.

HIDAPI has an error message for open failures, which this appends to the existing unable to open message.
@apmorton apmorton merged commit b433c11 into apmorton:master Feb 5, 2026
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

Successfully merging this pull request may close these issues.

2 participants