diff --git a/src/Volo.Abp.Core/Volo/Abp/IHasErrorCode.cs b/src/Volo.Abp.Core/Volo/Abp/IHasErrorCode.cs index 319bc00adc..1e30895fe6 100644 --- a/src/Volo.Abp.Core/Volo/Abp/IHasErrorCode.cs +++ b/src/Volo.Abp.Core/Volo/Abp/IHasErrorCode.cs @@ -2,6 +2,6 @@ { public interface IHasErrorCode { - int Code { get; set; } + string Code { get; set; } } } \ No newline at end of file diff --git a/src/Volo.Abp.Http/Volo/Abp/Http/RemoteServiceErrorInfo.cs b/src/Volo.Abp.Http/Volo/Abp/Http/RemoteServiceErrorInfo.cs index bfe6af3aa2..25792d1b24 100644 --- a/src/Volo.Abp.Http/Volo/Abp/Http/RemoteServiceErrorInfo.cs +++ b/src/Volo.Abp.Http/Volo/Abp/Http/RemoteServiceErrorInfo.cs @@ -11,7 +11,7 @@ namespace Volo.Abp.Http /// /// Error code. /// - public int Code { get; set; } + public string Code { get; set; } /// /// Error message. @@ -36,55 +36,16 @@ namespace Volo.Abp.Http } - /// - /// Creates a new instance of . - /// - /// Error message - public RemoteServiceErrorInfo(string message) - { - Message = message; - } - - /// - /// Creates a new instance of . - /// - /// Error code - public RemoteServiceErrorInfo(int code) - { - Code = code; - } - /// /// Creates a new instance of . /// /// Error code - /// Error message - public RemoteServiceErrorInfo(int code, string message) - : this(message) - { - Code = code; - } - - /// - /// Creates a new instance of . - /// - /// Error message /// Error details - public RemoteServiceErrorInfo(string message, string details) - : this(message) - { - Details = details; - } - - /// - /// Creates a new instance of . - /// - /// Error code /// Error message - /// Error details - public RemoteServiceErrorInfo(int code, string message, string details) - : this(message, details) + public RemoteServiceErrorInfo(string message, string details = null, string code = null) { + Message = message; + Details = details; Code = code; } } diff --git a/src/Volo.Abp.UI/Volo/Abp/Ui/UserFriendlyException.cs b/src/Volo.Abp.UI/Volo/Abp/Ui/UserFriendlyException.cs index 02c1bee77e..95c5e0a265 100644 --- a/src/Volo.Abp.UI/Volo/Abp/Ui/UserFriendlyException.cs +++ b/src/Volo.Abp.UI/Volo/Abp/Ui/UserFriendlyException.cs @@ -19,7 +19,7 @@ namespace Volo.Abp.UI /// /// An arbitrary error code. /// - public int Code { get; set; } + public string Code { get; set; } /// /// Severity of the exception. @@ -65,17 +65,6 @@ namespace Volo.Abp.UI LogLevel = logLevel; } - /// - /// Constructor. - /// - /// Error code - /// Exception message - public UserFriendlyException(int code, string message) - : this(message) - { - Code = code; - } - /// /// Constructor. /// @@ -87,18 +76,6 @@ namespace Volo.Abp.UI Details = details; } - /// - /// Constructor. - /// - /// Error code - /// Exception message - /// Additional information about the exception - public UserFriendlyException(int code, string message, string details) - : this(message, details) - { - Code = code; - } - /// /// Constructor. ///