-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #575 from radixdlt/return-408-on-timeout
return 408 status code on request timeout.
- Loading branch information
Showing
4 changed files
with
19 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
16 changes: 16 additions & 0 deletions
16
src/RadixDlt.NetworkGateway.GatewayApi/Exceptions/RequestTimeoutException.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace RadixDlt.NetworkGateway.GatewayApi.Exceptions; | ||
|
||
public sealed class RequestTimeoutException : KnownGatewayErrorException | ||
{ | ||
/// <summary> | ||
/// Non standard status code (there's no suitable one for such situation). | ||
/// In cloudflare means that the server received complete request but it took to long to process on server side. | ||
/// Wanted to filter these cases out from standard internal server errors. | ||
/// </summary> | ||
private const int RequestTimeoutHttpStatusCode = 524; | ||
|
||
public RequestTimeoutException(string traceId, string internalMessage) | ||
: base(RequestTimeoutHttpStatusCode, null, $"Request timed out. If reporting this issue, please include TraceId={traceId}", internalMessage) | ||
{ | ||
} | ||
} |