Skip to content

Commit

Permalink
fix:middleware catch (#645)
Browse files Browse the repository at this point in the history
* fix:middleware catch

* fix:code smell

* feat:globak ysubg
  • Loading branch information
MayueCif authored Jul 11, 2023
1 parent 27ad6c8 commit eeb3ad8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ namespace Masa.Contrib.StackSdks.Auth;

public class EnvironmentMiddleware : ICallerMiddleware
{
readonly ILogger<EnvironmentMiddleware>? _logger;

public EnvironmentMiddleware(ILoggerFactory? loggerFactory = null)
{
_logger = loggerFactory?.CreateLogger<EnvironmentMiddleware>();
}

public async Task HandleAsync(MasaHttpContext masaHttpContext, CallerHandlerDelegate next, CancellationToken cancellationToken = default)
{

Expand All @@ -23,6 +30,10 @@ public async Task HandleAsync(MasaHttpContext masaHttpContext, CallerHandlerDele
}
}
}
catch (Exception exception)
{
_logger?.LogDebug(exception, "Environment Middleware Deserialize!");
}
finally
{
await next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
global using Masa.Contrib.StackSdks.Auth.Model;
global using Masa.Contrib.StackSdks.Auth.Service;
global using Microsoft.Extensions.Configuration;
global using System.Net.Http.Json;
global using Microsoft.Extensions.Logging;
global using System.Text.Json;
global using static Masa.Contrib.StackSdks.Auth.Constants;

0 comments on commit eeb3ad8

Please sign in to comment.