Skip to content

Commit

Permalink
Handle 429 responses in a message handler
Browse files Browse the repository at this point in the history
  • Loading branch information
sliekens committed Jun 14, 2019
1 parent d55b669 commit b60b4b9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
22 changes: 22 additions & 0 deletions GW2SDK/Features/Common/TooManyRequestsException.cs
@@ -0,0 +1,22 @@
using System;
using GW2SDK.Infrastructure;

namespace GW2SDK.Features.Common
{
public sealed class TooManyRequestsException : InvalidOperationException
{
public TooManyRequestsException()
{
}

public TooManyRequestsException([CanBeNull] string message)
: base(message)
{
}

public TooManyRequestsException([CanBeNull] string message, [CanBeNull] Exception innerException)
: base(message, innerException)
{
}
}
}
9 changes: 9 additions & 0 deletions GW2SDK/Infrastructure/Common/HttpStatusCodeEx.cs
@@ -0,0 +1,9 @@
using System.Net;

namespace GW2SDK.Infrastructure.Common
{
public static class HttpStatusCodeEx
{
public const HttpStatusCode TooManyRequests = (HttpStatusCode) 429;
}
}

0 comments on commit b60b4b9

Please sign in to comment.