Browse Source
Merge pull request #14149 from abpframework/RemoteServiceErrorInfo
Add `data` to `RemoteServiceErrorInfo`.
pull/14152/head
liangshiwei
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
7 additions and
2 deletions
-
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/AspNetCore/ExceptionHandling/DefaultExceptionToErrorInfoConverter.cs
-
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/Http/RemoteServiceErrorInfo.cs
|
|
|
@ -219,7 +219,7 @@ public class DefaultExceptionToErrorInfoConverter : IExceptionToErrorInfoConvert |
|
|
|
|
|
|
|
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) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -24,6 +24,9 @@ public class RemoteServiceErrorInfo |
|
|
|
/// </summary>
|
|
|
|
public string Details { get; set; } |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Error data.
|
|
|
|
/// </summary>
|
|
|
|
public IDictionary Data { get; set; } |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -45,10 +48,12 @@ public class RemoteServiceErrorInfo |
|
|
|
/// <param name="code">Error code</param>
|
|
|
|
/// <param name="details">Error details</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; |
|
|
|
Details = details; |
|
|
|
Code = code; |
|
|
|
Data = data; |
|
|
|
} |
|
|
|
} |
|
|
|
|