You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/src/NzbDrone.Common/Http/TooManyRequestsException.cs

22 lines
590 B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NzbDrone.Common.Http
{
public class TooManyRequestsException : HttpException
{
public TimeSpan RetryAfter { get; private set; }
public TooManyRequestsException(HttpRequest request, HttpResponse response)
: base(request, response)
{
if (response.Headers.ContainsKey("Retry-After"))
{
RetryAfter = TimeSpan.FromSeconds(int.Parse(response.Headers["Retry-After"].ToString()));
}
}
}
}