Use Python 3 super(), and add self.message back to my exceptions
This commit is contained in:
parent
97d17de8ad
commit
752a9b36ae
|
@ -9,7 +9,7 @@ class Error(Exception):
|
|||
message = None,
|
||||
url = None,
|
||||
traceback = None):
|
||||
Exception.__init__(self, status)
|
||||
super().__init__(status)
|
||||
self.status = status # e.g. "400 Bad Request"
|
||||
self.message = message # textual message from the server
|
||||
self.url = url # URL we were requesting
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
class NilmDBError(Exception):
|
||||
"""Base exception for NilmDB errors"""
|
||||
def __init__(self, message = "Unspecified error"):
|
||||
Exception.__init__(self, message)
|
||||
super().__init__(message)
|
||||
self.message = message
|
||||
|
||||
class StreamError(NilmDBError):
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue
Block a user