mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-23 07:35:25 +00:00
Stop manufacturing Response objects just to create an exception
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user