From 2221e0a4d0a4ada70497f1459c2f6c1760813a37 Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 27 Sep 2022 11:53:57 +0800 Subject: [PATCH] Add `data` to `RemoteServiceErrorInfo`. Resolve #13996 --- .../DefaultExceptionToErrorInfoConverter.cs | 2 +- .../Volo/Abp/Http/RemoteServiceErrorInfo.cs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/AspNetCore/ExceptionHandling/DefaultExceptionToErrorInfoConverter.cs b/framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/AspNetCore/ExceptionHandling/DefaultExceptionToErrorInfoConverter.cs index b0917b08e0..1b8742af81 100644 --- a/framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/AspNetCore/ExceptionHandling/DefaultExceptionToErrorInfoConverter.cs +++ b/framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/AspNetCore/ExceptionHandling/DefaultExceptionToErrorInfoConverter.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) { diff --git a/framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/Http/RemoteServiceErrorInfo.cs b/framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/Http/RemoteServiceErrorInfo.cs index dd5f2e9dd0..89ed87454a 100644 --- a/framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/Http/RemoteServiceErrorInfo.cs +++ b/framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/Http/RemoteServiceErrorInfo.cs @@ -24,6 +24,9 @@ public class RemoteServiceErrorInfo /// public string Details { get; set; } + /// + /// Error data. + /// public IDictionary Data { get; set; } /// @@ -45,10 +48,12 @@ public class RemoteServiceErrorInfo /// Error code /// Error details /// Error message - public RemoteServiceErrorInfo(string message, string details = null, string code = null) + /// Error data + public RemoteServiceErrorInfo(string message, string details = null, string code = null, IDictionary data = null) { Message = message; Details = details; Code = code; + Data = data; } }