mirror of
https://github.com/aljazceru/plugins.git
synced 2026-01-11 17:24:20 +01:00
rebalance: Re-raise all exceptions in cleanup()
This solves an apparent logic error where errors that are not a subclass of RpcError would be reported as succesful rebalance. Change it so that they are re-raised too, so the caller can report them. Should fix #355.
This commit is contained in:
@@ -113,11 +113,12 @@ def cleanup(label, payload, rpc_result, error=None):
|
||||
if 'status is paid' in e.error.get('message', ""):
|
||||
return rpc_result
|
||||
|
||||
if error is not None and isinstance(error, RpcError):
|
||||
# unwrap rebalance errors as 'normal' RPC result
|
||||
if error.method == "rebalance":
|
||||
return {"status": "exception",
|
||||
"message": error.error.get('message', "error not given")}
|
||||
if error is not None:
|
||||
if isinstance(error, RpcError):
|
||||
# unwrap rebalance errors as 'normal' RPC result
|
||||
if error.method == "rebalance":
|
||||
return {"status": "exception",
|
||||
"message": error.error.get('message', "error not given")}
|
||||
raise error
|
||||
|
||||
return rpc_result
|
||||
|
||||
Reference in New Issue
Block a user