Skip to content

Commit 5d8fade

Browse files
author
Jeroen van der Heijden
committed
Added custom exception
1 parent e3fb99b commit 5d8fade

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

thingsdb/client/protocol.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from ..exceptions import AssertionError
88
from ..exceptions import AuthError
99
from ..exceptions import BadDataError
10+
from ..exceptions import CustomError
1011
from ..exceptions import ForbiddenError
1112
from ..exceptions import InternalError
1213
from ..exceptions import LookupError
@@ -108,7 +109,7 @@ class Err(enum.IntEnum):
108109
Proto.RES_DATA: lambda f, d: f.set_result(d),
109110
Proto.RES_ERROR: lambda f, d: f.set_exception(_ERRMAP.get(
110111
d['error_code'],
111-
ThingsDBError)(errdata=d)),
112+
CustomError)(errdata=d)),
112113
}
113114

114115
_PROTO_EVENTS = (

thingsdb/exceptions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ def __init__(self, *args, errdata=None):
1515
super().__init__(*args)
1616

1717

18+
class CustomError(ThingsDBError):
19+
pass
20+
21+
1822
class OperationError(ThingsDBError):
1923
pass
2024

thingsdb/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.6.14'
1+
__version__ = '0.6.15'

0 commit comments

Comments
 (0)