Skip to content

Commit

Permalink
Add easily accessible properties to DeviceError exception (#488)
Browse files Browse the repository at this point in the history
* Add easily accessible properties to DeviceError exception

* Fix typo
  • Loading branch information
syssi authored and rytilahti committed Mar 24, 2019
1 parent 4322421 commit 11b88f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion miio/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ class DeviceException(Exception):

class DeviceError(DeviceException):
"""Exception communicating an error delivered by the target device."""
pass
def __init__(self, error):
self.code = error.get('code')
self.message = error.get('message')


class RecoverableError(DeviceError):
Expand Down

0 comments on commit 11b88f6

Please sign in to comment.