Skip to content

Commit

Permalink
Backend/Ether: handle/retry RPC error -39000
Browse files Browse the repository at this point in the history
Add code -39000 (UnparsableResponseType) to RpcErrorCode
enum and process it since this error was encountered during
integration testing.
  • Loading branch information
webwarrior-ws committed Aug 21, 2024
1 parent 06c557d commit ff16548
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/GWallet.Backend/Ether/EtherExceptions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type RpcErrorCode =
| CannotFulfillRequest = -32046
| ResourceNotFound = -32001
| InternalError = -32603
| UnparsableResponseType = -39000

type ServerCannotBeResolvedException =
inherit CommunicationUnsuccessfulException
Expand Down
2 changes: 2 additions & 0 deletions src/GWallet.Backend/Ether/EtherServer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ module Server =
raise <| ServerMisconfiguredException(exMsg, rpcResponseEx)
| i when i = int RpcErrorCode.InternalError ->
raise <| ServerFaultException(exMsg, rpcResponseEx)
| j when j = int RpcErrorCode.UnparsableResponseType ->
raise <| ServerFaultException(exMsg, rpcResponseEx)
| _ ->
raise
<| Exception (SPrintF3 "RpcResponseException with RpcError Code <%i> and Message '%s' (%s)"
Expand Down

0 comments on commit ff16548

Please sign in to comment.