Created
May 13, 2019 21:26
-
-
Save knocte/301a7d862e4633417e37831da9b0b3e9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iff --git a/src/GWallet.Backend/Ether/EtherServer.fs b/src/GWallet.Backend/Ether/EtherServer.fs | |
index f7d4c7e..15e9d50 100644 | |
--- a/src/GWallet.Backend/Ether/EtherServer.fs | |
+++ b/src/GWallet.Backend/Ether/EtherServer.fs | |
@@ -40,14 +40,6 @@ module Server = | |
type ServerChannelNegotiationException(message:string, innerException: Exception) = | |
inherit ConnectionUnsuccessfulException (message, innerException) | |
- type ServerMisconfiguredException = | |
- inherit ConnectionUnsuccessfulException | |
- | |
- new (message:string, innerException: Exception) = | |
- { inherit ConnectionUnsuccessfulException (message, innerException) } | |
- new (message:string) = | |
- { inherit ConnectionUnsuccessfulException (message) } | |
- | |
type ServerRestrictiveException(message:string, innerException: Exception) = | |
inherit ConnectionUnsuccessfulException (message, innerException) | |
diff --git a/src/GWallet.Backend/Networking.fs b/src/GWallet.Backend/Networking.fs | |
index b343ea9..cdeefb6 100644 | |
--- a/src/GWallet.Backend/Networking.fs | |
+++ b/src/GWallet.Backend/Networking.fs | |
@@ -35,6 +35,14 @@ type ServerTimedOutException = | |
type ServerUnreachableException(message:string, innerException: Exception) = | |
inherit ConnectionUnsuccessfulException (message, innerException) | |
+type ServerMisconfiguredException = | |
+ inherit ConnectionUnsuccessfulException | |
+ | |
+ new (message:string, innerException: Exception) = | |
+ { inherit ConnectionUnsuccessfulException (message, innerException) } | |
+ new (message:string) = | |
+ { inherit ConnectionUnsuccessfulException (message) } | |
+ | |
module Networking = | |
// Ubuntu 18.04 LTS still brings a very old version of Mono (4.6.2) that doesn't have TLS1.2 support | |
diff --git a/src/GWallet.Backend/UtxoCoin/StratumClient.fs b/src/GWallet.Backend/UtxoCoin/StratumClient.fs | |
index 1795ad0..1114dea 100644 | |
--- a/src/GWallet.Backend/UtxoCoin/StratumClient.fs | |
+++ b/src/GWallet.Backend/UtxoCoin/StratumClient.fs | |
@@ -112,6 +112,10 @@ type StratumClient (jsonRpcClient: JsonRpcTcpClient) = | |
| :? ElectrumServerReturningErrorInJsonResponseException as ex -> | |
if (ex.ErrorCode = -32603) then | |
return raise(ElectrumServerReturningInternalErrorException(ex.Message, ex.ErrorCode, jsonRequest, rawResponse)) | |
+ if ex.ErrorCode = -32601 then | |
+ return raise <| ServerMisconfiguredException(ex.Message, ex) | |
+ elif ex.ErrorCode = -101 then | |
+ return raise <| ServerUnavailabilityException(ex.Message, ex) | |
return raise(ElectrumServerReturningErrorException(ex.Message, ex.ErrorCode, jsonRequest, rawResponse)) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment