Browse Source

Merge pull request #24230 from abpframework/DefaultExceptionToErrorInfoConverter

Convert exceptions using `AbpExceptionHandlingOptions`.
pull/24249/head
Engincan VESKE 10 months ago
committed by GitHub
parent
commit
44ac32441a
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 7
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/AspNetCore/ExceptionHandling/DefaultExceptionToErrorInfoConverter.cs

7
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/AspNetCore/ExceptionHandling/DefaultExceptionToErrorInfoConverter.cs

@ -21,17 +21,20 @@ namespace Volo.Abp.AspNetCore.ExceptionHandling;
public class DefaultExceptionToErrorInfoConverter : IExceptionToErrorInfoConverter, ITransientDependency public class DefaultExceptionToErrorInfoConverter : IExceptionToErrorInfoConverter, ITransientDependency
{ {
protected AbpExceptionHandlingOptions ExceptionHandlingOptions { get; }
protected AbpExceptionLocalizationOptions LocalizationOptions { get; } protected AbpExceptionLocalizationOptions LocalizationOptions { get; }
protected IStringLocalizerFactory StringLocalizerFactory { get; } protected IStringLocalizerFactory StringLocalizerFactory { get; }
protected IStringLocalizer<AbpExceptionHandlingResource> L { get; } protected IStringLocalizer<AbpExceptionHandlingResource> L { get; }
protected IServiceProvider ServiceProvider { get; } protected IServiceProvider ServiceProvider { get; }
public DefaultExceptionToErrorInfoConverter( public DefaultExceptionToErrorInfoConverter(
IOptions<AbpExceptionHandlingOptions> exceptionHandlingOptions,
IOptions<AbpExceptionLocalizationOptions> localizationOptions, IOptions<AbpExceptionLocalizationOptions> localizationOptions,
IStringLocalizerFactory stringLocalizerFactory, IStringLocalizerFactory stringLocalizerFactory,
IStringLocalizer<AbpExceptionHandlingResource> stringLocalizer, IStringLocalizer<AbpExceptionHandlingResource> stringLocalizer,
IServiceProvider serviceProvider) IServiceProvider serviceProvider)
{ {
ExceptionHandlingOptions = exceptionHandlingOptions.Value;
ServiceProvider = serviceProvider; ServiceProvider = serviceProvider;
StringLocalizerFactory = stringLocalizerFactory; StringLocalizerFactory = stringLocalizerFactory;
L = stringLocalizer; L = stringLocalizer;
@ -327,8 +330,8 @@ public class DefaultExceptionToErrorInfoConverter : IExceptionToErrorInfoConvert
{ {
return new AbpExceptionHandlingOptions return new AbpExceptionHandlingOptions
{ {
SendExceptionsDetailsToClients = false, SendExceptionsDetailsToClients = ExceptionHandlingOptions.SendExceptionsDetailsToClients,
SendStackTraceToClients = true SendStackTraceToClients = ExceptionHandlingOptions.SendStackTraceToClients
}; };
} }
} }

Loading…
Cancel
Save