From 6644cd9aab12db762a8d62c1bb01c1bd4ecc3d83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Fri, 27 Apr 2018 10:28:49 +0300 Subject: [PATCH] Make the error code string --- src/Volo.Abp.Core/Volo/Abp/IHasErrorCode.cs | 2 +- .../Volo/Abp/Http/RemoteServiceErrorInfo.cs | 47 ++----------------- .../Volo/Abp/Ui/UserFriendlyException.cs | 25 +--------- 3 files changed, 6 insertions(+), 68 deletions(-) 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. ///