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

csharp.ApiException.mustache Maven / Gradle / Ivy

There is a newer version: 7.8.0
Show newest version
{{>partial_header}}
using System;

namespace {{packageName}}.Client
{
    /// 
    /// API Exception
    /// 
    {{>visibility}} class ApiException : Exception
    {
        /// 
        /// Gets or sets the error code (HTTP status code)
        /// 
        /// The error code (HTTP status code).
        public int ErrorCode { get; set; }

        /// 
        /// Gets or sets the error content (body json object)
        /// 
        /// The error content (Http response body).
        public {{#supportsAsync}}dynamic{{/supportsAsync}}{{^supportsAsync}}object{{/supportsAsync}} ErrorContent { get; private set; }

        /// 
        /// Initializes a new instance of the  class.
        /// 
        public ApiException() {}

        /// 
        /// Initializes a new instance of the  class.
        /// 
        /// HTTP status code.
        /// Error message.
        public ApiException(int errorCode, string message) : base(message)
        {
            this.ErrorCode = errorCode;
        }

        /// 
        /// Initializes a new instance of the  class.
        /// 
        /// HTTP status code.
        /// Error message.
        /// Error content.
        public ApiException(int errorCode, string message, {{#supportsAsync}}dynamic{{/supportsAsync}}{{^supportsAsync}}object{{/supportsAsync}} errorContent = null) : base(message)
        {
            this.ErrorCode = errorCode;
            this.ErrorContent = errorContent;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy