All Downloads are FREE. Search and download functionalities are using the official Maven repository.

csharp.libraries.generichost.ApiException.mustache Maven / Gradle / Ivy

There is a newer version: 7.9.0
Show newest version
// 
{{>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;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy