Skip to content

Commit

Permalink
catch remote i/o error (refs #29)
Browse files Browse the repository at this point in the history
  • Loading branch information
thijstriemstra committed Mar 7, 2017
1 parent 78675e0 commit fb63197
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions luma/core/serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ def __init__(self, bus=None, port=1, address=0x3C):
# PermissionError
raise luma.core.error.DevicePermissionError(
'I2C device permission denied: {}'.format(e.filename))
elif e.errno == errno.EREMOTEIO:
# Remote I/O error
raise luma.core.error.DeviceNotFoundError(
'I2C device not found on address: {}'.format(address))
else: # pragma: no cover
raise

Expand Down

0 comments on commit fb63197

Please sign in to comment.