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:
Sale Djenic 2022-11-08 14:37:38 +01:00 committed by saledjenic
parent 3da62c9092
commit 2ea83c02b0
1 changed files with 3 additions and 3 deletions

View File

@ -29,7 +29,7 @@ proc makePrivateRpcCall*(
error "rpc response error", err
raise newException(ValueError, err)
except RpcException as e:
except Exception as e:
error "error doing rpc request", methodName = methodName, exception=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)
let rpcResponseRaw = status_go.sendTransactionWithChainId(chainId, inputJSON, hashed_password)
result = Json.decode(rpcResponseRaw, RpcResponse[JsonNode])
except RpcException as e:
except Exception as e:
error "error sending tx", inputJSON, exception=e.msg
raise newException(RpcException, e.msg)
@ -76,7 +76,7 @@ proc migrateKeyStoreDir*(account: string, password: string, oldKeystoreDir: stri
try:
var hashed_password = "0x" & $keccak_256.digest(password)
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
raise newException(RpcException, e.msg)