Stop manufacturing Response objects just to create an exception

This commit is contained in:
Haacked
2015-01-01 22:23:04 -08:00
parent c2d51570fd
commit d8f50292e3
5 changed files with 30 additions and 11 deletions

View File

@@ -3,7 +3,6 @@ using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Runtime.Serialization;
using Octokit.Internal;
namespace Octokit
{
@@ -20,7 +19,7 @@ namespace Octokit
/// <summary>
/// Constructs an instance of AuthorizationException
/// </summary>
public AuthorizationException() : base(new Response { StatusCode = HttpStatusCode.Unauthorized })
public AuthorizationException() : base(HttpStatusCode.Unauthorized, null)
{
}
@@ -45,6 +44,11 @@ namespace Octokit
"AuthorizationException created with wrong status code");
}
public AuthorizationException(HttpStatusCode httpStatusCode, Exception innerException)
: base(httpStatusCode, innerException)
{
}
#if !NETFX_CORE
/// <summary>
/// Constructs an instance of AuthorizationException.