Browse Source

Reduce some code.

pull/10387/head
maliming 5 years ago
parent
commit
9dec319c2c
No known key found for this signature in database GPG Key ID: 96224957E51C89E
  1. 2
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/AspNetCore/ExceptionHandling/DefaultExceptionToErrorInfoConverter.cs
  2. 8
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/Http/Client/AbpRemoteCallException.cs
  3. 3
      framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/ClientProxying/ClientProxyBase.cs

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

@ -42,7 +42,7 @@ namespace Volo.Abp.AspNetCore.ExceptionHandling
{
var errorInfo = CreateErrorInfoWithoutCode(exception, includeSensitiveDetails);
if (exception is IHasErrorCode hasErrorCodeException && hasErrorCodeException.Code.IsNullOrWhiteSpace())
if (exception is IHasErrorCode hasErrorCodeException)
{
errorInfo.Code = hasErrorCodeException.Code;
}

8
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/Http/Client/AbpRemoteCallException.cs

@ -15,13 +15,7 @@ namespace Volo.Abp.Http.Client
public RemoteServiceErrorInfo Error { get; set; }
public AbpRemoteCallException(string message)
: base(message)
{
}
public AbpRemoteCallException(string message, Exception innerException)
public AbpRemoteCallException(string message, Exception innerException = null)
: base(message, innerException)
{

3
framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/ClientProxying/ClientProxyBase.cs

@ -6,8 +6,6 @@ using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Primitives;
using Volo.Abp.Content;
@ -28,7 +26,6 @@ namespace Volo.Abp.Http.Client.ClientProxying
{
public IAbpLazyServiceProvider LazyServiceProvider { get; set; }
protected ILogger<ClientProxyBase<TService>> Logger => LazyServiceProvider.LazyGetService<ILogger<ClientProxyBase<TService>>>(NullLogger<ClientProxyBase<TService>>.Instance);
protected IClientProxyApiDescriptionFinder ClientProxyApiDescriptionFinder => LazyServiceProvider.LazyGetRequiredService<IClientProxyApiDescriptionFinder>();
protected ICancellationTokenProvider CancellationTokenProvider => LazyServiceProvider.LazyGetRequiredService<ICancellationTokenProvider>();
protected ICorrelationIdProvider CorrelationIdProvider => LazyServiceProvider.LazyGetRequiredService<ICorrelationIdProvider>();

Loading…
Cancel
Save