@@ -41,10 +41,17 @@ class DatabaseError(Error):
41
41
Exception raised for errors that are related to the database.
42
42
"""
43
43
44
- def __init__ (self , * args ):
44
+ def __init__ (self , * args , extra_info = None ):
45
45
"""
46
46
:param args: ``(code, message)`` or ``(message,)``.
47
47
:type args: :obj:`tuple`
48
+
49
+ :param extra_info: Additional `box.error`_ information
50
+ with backtrace.
51
+ :type extra_info: :class:`~tarantool.types.BoxError` or
52
+ :obj:`None`, optional
53
+
54
+ .. _box.error: https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_error/error/
48
55
"""
49
56
50
57
super ().__init__ (* args )
@@ -59,6 +66,8 @@ def __init__(self, *args):
59
66
self .code = 0
60
67
self .message = ''
61
68
69
+ self .extra_info = extra_info
70
+
62
71
63
72
class DataError (DatabaseError ):
64
73
"""
@@ -235,7 +244,7 @@ class NetworkError(DatabaseError):
235
244
Error related to network.
236
245
"""
237
246
238
- def __init__ (self , orig_exception = None , * args ):
247
+ def __init__ (self , orig_exception = None , * args , ** kwargs ):
239
248
"""
240
249
:param orig_exception: Exception to wrap.
241
250
:type orig_exception: optional
@@ -256,7 +265,7 @@ def __init__(self, orig_exception=None, *args):
256
265
super (NetworkError , self ).__init__ (
257
266
orig_exception .errno , self .message )
258
267
else :
259
- super (NetworkError , self ).__init__ (orig_exception , * args )
268
+ super (NetworkError , self ).__init__ (orig_exception , * args , ** kwargs )
260
269
261
270
262
271
class NetworkWarning (UserWarning ):
0 commit comments