Skip to content

Commit

Permalink
Backend/Ether: retry/catch InternalErr=-32603 code
Browse files Browse the repository at this point in the history
  • Loading branch information
knocte committed Nov 22, 2023
1 parent 6f4d186 commit 2abf306
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 @@ -32,6 +32,7 @@ type RpcErrorCode =
| DailyRequestCountExceededSoRequestRateLimited = -32005
| CannotFulfillRequest = -32046
| ResourceNotFound = -32001
| InternalError = -32603

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 @@ -223,6 +223,8 @@ module Server =
raise <| ServerRefusedException(exMsg, rpcResponseEx)
| h when h = int RpcErrorCode.ResourceNotFound ->
raise <| ServerMisconfiguredException(exMsg, rpcResponseEx)
| i when i = int RpcErrorCode.InternalError ->
raise <| ServerFaultException(exMsg, rpcResponseEx)
| _ ->
raise
<| Exception (SPrintF3 "RpcResponseException with RpcError Code <%i> and Message '%s' (%s)"
Expand Down

0 comments on commit 2abf306

Please sign in to comment.