Skip to content

Commit

Permalink
Merge pull request #103 from octokit/haacked/refactor
Browse files Browse the repository at this point in the history
Use the dictionary for 404
  • Loading branch information
haacked committed Oct 30, 2013
2 parents ca052c8 + 099db40 commit d7a9140
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Octokit/Http/Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ async Task<IResponse<T>> RunRequest<T>(IRequest request)
{
{ HttpStatusCode.Unauthorized, GetExceptionForUnauthorized },
{ HttpStatusCode.Forbidden, GetExceptionForForbidden },
{ HttpStatusCode.NotFound, response => new NotFoundException(response) },
{ (HttpStatusCode)422, response => new ApiValidationException(response) }
};

Expand All @@ -293,11 +294,6 @@ static void HandleErrors(IResponse response)
throw exceptionFunc(response);
}

if ((int)response.StatusCode == 404)
{
throw new NotFoundException(response);
}

if ((int)response.StatusCode >= 400)
{
throw new ApiException(response);
Expand Down

0 comments on commit d7a9140

Please sign in to comment.