File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -117,18 +117,21 @@ def handle_grpc_error(err):
117
117
118
118
Parameters
119
119
----------
120
- err: grpc.RpcError
120
+ err: Union[ grpc.RpcError, btrdb.BTrDBError]
121
121
"""
122
122
details = err .details ()
123
- if details == "[404] stream does not exist" :
124
- raise StreamNotFoundError ("Stream not found with provided uuid" ) from None
125
- elif details == "failed to connect to all addresses" :
126
- raise ConnectionError ("Failed to connect to BTrDB" ) from None
127
- elif any (str (e ) in err .details () for e in BTRDB_SERVER_ERRORS ):
128
- raise BTRDBServerError ("An error has occured with btrdb-server" ) from None
129
- elif str (err .code ()) == "StatusCode.PERMISSION_DENIED" :
130
- raise PermissionDenied (details ) from None
131
- raise BTrDBError (details ) from None
123
+ if isinstance (err , BTrDBError ):
124
+ if details == "[404] stream does not exist" :
125
+ raise StreamNotFoundError ("Stream not found with provided uuid" ) from None
126
+ elif details == "failed to connect to all addresses" :
127
+ raise ConnectionError ("Failed to connect to BTrDB" ) from None
128
+ elif any (str (e ) in err .details () for e in BTRDB_SERVER_ERRORS ):
129
+ raise BTRDBServerError ("An error has occured with btrdb-server" ) from None
130
+ elif str (err .code ()) == "StatusCode.PERMISSION_DENIED" :
131
+ raise PermissionDenied (details ) from None
132
+ raise BTrDBError (details ) from None
133
+ else :
134
+ raise err
132
135
133
136
134
137
def check_proto_stat (stat ):
You can’t perform that action at this time.
0 commit comments