fix(@desktop/general): crash handling unknown exceptions fixed
If any but the `RpcException` was thrown while handling remote procedures responses app crash happened. Fixed in this by accepting more general exception objects.
This commit is contained in:
parent
3da62c9092
commit
2ea83c02b0
|
@ -29,7 +29,7 @@ proc makePrivateRpcCall*(
|
||||||
error "rpc response error", err
|
error "rpc response error", err
|
||||||
raise newException(ValueError, err)
|
raise newException(ValueError, err)
|
||||||
|
|
||||||
except RpcException as e:
|
except Exception as e:
|
||||||
error "error doing rpc request", methodName = methodName, exception=e.msg
|
error "error doing rpc request", methodName = methodName, exception=e.msg
|
||||||
raise newException(RpcException, e.msg)
|
raise newException(RpcException, e.msg)
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ proc sendTransaction*(chainId: int, inputJSON: string, password: string): RpcRes
|
||||||
var hashed_password = "0x" & $keccak_256.digest(password)
|
var hashed_password = "0x" & $keccak_256.digest(password)
|
||||||
let rpcResponseRaw = status_go.sendTransactionWithChainId(chainId, inputJSON, hashed_password)
|
let rpcResponseRaw = status_go.sendTransactionWithChainId(chainId, inputJSON, hashed_password)
|
||||||
result = Json.decode(rpcResponseRaw, RpcResponse[JsonNode])
|
result = Json.decode(rpcResponseRaw, RpcResponse[JsonNode])
|
||||||
except RpcException as e:
|
except Exception as e:
|
||||||
error "error sending tx", inputJSON, exception=e.msg
|
error "error sending tx", inputJSON, exception=e.msg
|
||||||
raise newException(RpcException, e.msg)
|
raise newException(RpcException, e.msg)
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ proc migrateKeyStoreDir*(account: string, password: string, oldKeystoreDir: stri
|
||||||
try:
|
try:
|
||||||
var hashed_password = "0x" & $keccak_256.digest(password)
|
var hashed_password = "0x" & $keccak_256.digest(password)
|
||||||
discard status_go.migrateKeyStoreDir(account, hashed_password, oldKeystoreDir, multiaccountKeystoreDir)
|
discard status_go.migrateKeyStoreDir(account, hashed_password, oldKeystoreDir, multiaccountKeystoreDir)
|
||||||
except RpcException as e:
|
except Exception as e:
|
||||||
error "error migrating keystore dir", account, exception=e.msg
|
error "error migrating keystore dir", account, exception=e.msg
|
||||||
raise newException(RpcException, e.msg)
|
raise newException(RpcException, e.msg)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue