We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello,
it would be nice to have some exceptions to be thrown:
blinkstick.connect()
BlinkStickConnectionException
Hacky solution that includes general OSError to catch pointless find_all() call:
OSError
find_all()
api = None try: from blinkstick import blinkstick try: api = blinkstick api.find_all() except OSError: exit(wording.get('connection_no').format('AGILE INNOVATIVE BLINKSTICK') + wording.get('exclamation_mark')) return api except ImportError: exit(wording.get('package_no').format('BLINKSTICK') + wording.get('exclamation_mark'))
Wanted solution that throws BlinkStickConnectionException:
def api_factory(): api = None try: from blinkstick.blinkstick import BlinkStickConnectionException try: api = blinkstick blinkstick.connect() except BlinkStickConnectionException: exit(wording.get('connection_no').format('AGILE INNOVATIVE BLINKSTICK') + wording.get('exclamation_mark')) return api except ImportError: exit(wording.get('package_no').format('BLINKSTICK') + wording.get('exclamation_mark'))
Connect method could look similar to this:
def connect(vendor_id : str, product_id : str) -> None: try: hidraw = hid.device(vendor_id, product_id) hidraw.open(vendor_id, product_id) hidraw.close() except OSError: raise BlinkStickConnectionException
The text was updated successfully, but these errors were encountered:
I second this. The exceptions being thrown are utterly unhelpful.
Sorry, something went wrong.
No branches or pull requests
Hello,
it would be nice to have some exceptions to be thrown:
blinkstick.connect()
should throwBlinkStickConnectionException
Hacky solution that includes general
OSError
to catch pointlessfind_all()
call:Wanted solution that throws
BlinkStickConnectionException
:Connect method could look similar to this:
The text was updated successfully, but these errors were encountered: