-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: introduce NoContentException (#131)
- Loading branch information
1 parent
14961f7
commit 82a5169
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using System.Net; | ||
|
||
namespace Pipedrive | ||
{ | ||
/// <summary> | ||
/// Represents a HTTP 204 - No content response returned from the API. | ||
/// </summary> | ||
public class NoContentException : ApiException | ||
{ | ||
/// <summary> | ||
/// Constructs an instance of NoContentException | ||
/// </summary> | ||
/// <param name="response">The HTTP payload from the server</param> | ||
public NoContentException(IResponse response) : this(response, null) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Constructs an instance of NoContentException | ||
/// </summary> | ||
/// <param name="response">The HTTP payload from the server</param> | ||
/// <param name="innerException">The inner exception</param> | ||
public NoContentException(IResponse response, Exception innerException) | ||
: base(response, innerException) | ||
{ | ||
Debug.Assert(response != null && response.StatusCode == HttpStatusCode.NoContent, | ||
"NoContentException created with wrong status code"); | ||
} | ||
|
||
public override string Message | ||
{ | ||
get { return ApiErrorMessageSafe ?? "No content"; } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters