csharp.libraries.generichost.ApiException.mustache Maven / Gradle / Ivy
//
{{>partial_header}}
{{#nrt}}
#nullable enable
{{/nrt}}
using System;
namespace {{packageName}}.{{clientPackage}}
{
///
/// API Exception
///
{{>visibility}} class ApiException : Exception
{
///
/// The reason the api request failed
///
public string{{nrt?}} ReasonPhrase { get; }
///
/// The HttpStatusCode
///
public System.Net.HttpStatusCode StatusCode { get; }
///
/// The raw data returned by the api
///
public string RawContent { get; }
///
/// Construct the ApiException from parts of the response
///
///
///
///
public ApiException(string{{nrt?}} reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent)
{
ReasonPhrase = reasonPhrase;
StatusCode = statusCode;
RawContent = rawContent;
}
}
}