mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-01 10:25:36 +00:00
Use the dictionary for 404
Cleaning up the code to use the dictionary lookup.
This commit is contained in:
@@ -281,6 +281,7 @@ namespace Octokit
|
||||
{
|
||||
{ HttpStatusCode.Unauthorized, GetExceptionForUnauthorized },
|
||||
{ HttpStatusCode.Forbidden, GetExceptionForForbidden },
|
||||
{ HttpStatusCode.NotFound, response => new NotFoundException(response) },
|
||||
{ (HttpStatusCode)422, response => new ApiValidationException(response) }
|
||||
};
|
||||
|
||||
@@ -293,11 +294,6 @@ namespace Octokit
|
||||
throw exceptionFunc(response);
|
||||
}
|
||||
|
||||
if ((int)response.StatusCode == 404)
|
||||
{
|
||||
throw new NotFoundException(response);
|
||||
}
|
||||
|
||||
if ((int)response.StatusCode >= 400)
|
||||
{
|
||||
throw new ApiException(response);
|
||||
|
||||
Reference in New Issue
Block a user