mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-05-31 02:05:39 +00:00
Add NotFoundException for 404 status
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user