Merge pull request #14149 from abpframework/RemoteServiceErrorInfo

Add `data` to `RemoteServiceErrorInfo`.
pull/14152/head
liangshiwei 3 years ago committed by GitHub
commit a225c89b81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -219,7 +219,7 @@ public class DefaultExceptionToErrorInfoConverter : IExceptionToErrorInfoConvert
AddExceptionToDetails(exception, detailBuilder, sendStackTraceToClients); AddExceptionToDetails(exception, detailBuilder, sendStackTraceToClients);
var errorInfo = new RemoteServiceErrorInfo(exception.Message, detailBuilder.ToString()); var errorInfo = new RemoteServiceErrorInfo(exception.Message, detailBuilder.ToString(), data: exception.Data);
if (exception is AbpValidationException) if (exception is AbpValidationException)
{ {

@ -24,6 +24,9 @@ public class RemoteServiceErrorInfo
/// </summary> /// </summary>
public string Details { get; set; } public string Details { get; set; }
/// <summary>
/// Error data.
/// </summary>
public IDictionary Data { get; set; } public IDictionary Data { get; set; }
/// <summary> /// <summary>
@ -45,10 +48,12 @@ public class RemoteServiceErrorInfo
/// <param name="code">Error code</param> /// <param name="code">Error code</param>
/// <param name="details">Error details</param> /// <param name="details">Error details</param>
/// <param name="message">Error message</param> /// <param name="message">Error message</param>
public RemoteServiceErrorInfo(string message, string details = null, string code = null) /// <param name="data">Error data</param>
public RemoteServiceErrorInfo(string message, string details = null, string code = null, IDictionary data = null)
{ {
Message = message; Message = message;
Details = details; Details = details;
Code = code; Code = code;
Data = data;
} }
} }

Loading…
Cancel
Save