using Opsoft.NetCore.O3App.Shared; using System; using System.Runtime.Serialization; namespace Opsoft.NetCore.O3App.Domain { /// /// O3App异常 /// [Serializable] public class O3AppException : Exception { public object Additional { get; set; } public int StatusCode { get; } public O3AppException() { } public O3AppException(string message) : base(message) { } public O3AppException(string message, Exception inner) : base(message, inner) { } protected O3AppException(SerializationInfo info, StreamingContext context) : base(info, context) { } /// /// Initializes a new instance of the O3AppException class with a specified StatusCode enum and a error message. /// public O3AppException(string message, int statusCode) : base(message) { StatusCode = statusCode; } /// /// Initializes a new instance of the O3AppException class with a specified StatusCode enum and a error message and a reference to the inner exception that is the cause of this exception. /// public O3AppException(string message, int statusCode, Exception inner) : base(message, inner) { StatusCode = statusCode; } /// /// Initializes a new instance of the O3AppException class with a specified StatusCode enum. /// public O3AppException(Enum @enum) : this(@enum.GetDesc(), @enum.ToInt32()) { } /// /// Initializes a new instance of the System.Exception class with a StatusCode eunm and a reference to the inner exception that is the cause of this exception. /// public O3AppException(Enum @enum, Exception inner) : this(@enum.GetDesc(), @enum.ToInt32(), inner) { } } }