#region ========================================================================= USING ===================================================================================== using Lumina.Presentation.Web.Common.Models.Common; using System.Net; #endregion namespace Lumina.Presentation.Web.Common.Exceptions; /// /// Custom exception for interaction with the remote API. /// public class ApiException : Exception { #region ==================================================================== PROPERTIES ================================================================================= /// /// Gets or sets the values of status codes defined for HTTP defined in RFC 2616 for HTTP 1.1. /// public HttpStatusCode HttpStatusCode { get; set; } /// /// Gets or sets the problem details represented by this exception. /// public ProblemDetailsModel? ProblemDetails { get; } #endregion #region ====================================================================== CTOR ===================================================================================== /// /// Initializes a new instance of the class. /// /// The problem details object returned by the API. /// The HTTP status code returned by the API. public ApiException(ProblemDetailsModel? problemDetails, HttpStatusCode httpStatusCode) : base(problemDetails?.Title ?? "An error occurred.") { ProblemDetails = problemDetails; HttpStatusCode = httpStatusCode; } #endregion }