Add NotFoundException for 404 status

This commit is contained in:
Haacked
2013-10-22 17:12:53 -07:00
parent ad210cecc7
commit 70b94187b3
5 changed files with 62 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Runtime.Serialization;
namespace Octokit
{
#if !NETFX_CORE
[Serializable]
#endif
[SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors",
Justification = "These exceptions are specific to the GitHub API and not general purpose exceptions")]
public class NotFoundException : ApiException
{
public NotFoundException(IResponse response) : this(response, null)
{
}
public NotFoundException(IResponse response, Exception innerException) : base(response, innerException)
{
Debug.Assert(response != null && response.StatusCode == HttpStatusCode.NotFound,
"NotFoundException created with wrong status code");
}
#if !NETFX_CORE
protected NotFoundException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
#endif
}
}