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

@@ -2,7 +2,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Runtime.Serialization;
using Octokit.Internal;
namespace Octokit
{
@@ -20,7 +19,7 @@ namespace Octokit
/// Constructs an instance of TwoFactorChallengeFailedException
/// </summary>
public TwoFactorChallengeFailedException() :
base(new Response { StatusCode = HttpStatusCode.Unauthorized })
base(HttpStatusCode.Unauthorized, null)
{
}
@@ -29,7 +28,7 @@ namespace Octokit
/// </summary>
/// <param name="innerException">The inner exception</param>
public TwoFactorChallengeFailedException(Exception innerException)
: base(new Response { StatusCode = HttpStatusCode.Unauthorized }, innerException)
: base(HttpStatusCode.Unauthorized, innerException)
{
}