Skip to content

Commit

Permalink
Backend: improve CloudFlare err detection
Browse files Browse the repository at this point in the history
Update error code detection function in EtherServer to
recognize another possible pattern: " XXX." where XXX is
error code in question.

This is needed to process error messages like this:
```
Example error message: "Response status code does not indicate success: 520."
```

Fixes https://nblockchain.sentry.io/issues/5511801428/
  • Loading branch information
webwarrior-ws authored and knocte committed Jun 27, 2024
1 parent 21770dd commit 02730f8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/GWallet.Backend/Ether/EtherServer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ module Server =

let HttpRequestExceptionMatchesErrorCode (ex: Http.HttpRequestException) (errorCode: int): bool =
ex.Message.StartsWith(SPrintF1 "%i " errorCode) || ex.Message.Contains(SPrintF1 " %i " errorCode)
|| ex.Message.Contains(SPrintF1 " %i." errorCode)

let exMsg = "Could not communicate with EtherServer"
let PerformEtherRemoteCallWithTimeout<'T,'R> (job: Async<'R>): Async<'R> = async {
Expand Down

0 comments on commit 02730f8

Please sign in to comment.