Skip to content

Commit

Permalink
fix error with unable to resolve service (#19)
Browse files Browse the repository at this point in the history
Co-authored-by: Artem Leshchev <artem.leshchev@dxc.com>
  • Loading branch information
aleshchev and Artem Leshchev authored Jul 8, 2024
1 parent 4730032 commit 8c86c61
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/Bss.Platform.Api.Middlewares/ErrorsMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
using Bss.Platform.Api.Middlewares.Interfaces;

using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

namespace Bss.Platform.Api.Middlewares;

public class ErrorsMiddleware(RequestDelegate next)
{
public async Task InvokeAsync(HttpContext context, ILogger<ErrorsMiddleware> logger, IStatusCodeResolver? statusCodeResolver)
public async Task InvokeAsync(HttpContext context, ILogger<ErrorsMiddleware> logger, IServiceProvider serviceProvider)
{
try
{
Expand All @@ -20,7 +21,7 @@ public async Task InvokeAsync(HttpContext context, ILogger<ErrorsMiddleware> log
{
logger.LogError(e, "Request failed");

await HandleExceptionAsync(context, e, statusCodeResolver);
await HandleExceptionAsync(context, e, serviceProvider.GetService<IStatusCodeResolver>());
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/__SolutionItems/CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
[assembly: AssemblyCompany("Luxoft")]
[assembly: AssemblyCopyright("Copyright © Luxoft 2024")]

[assembly: AssemblyVersion("1.5.4.0")]
[assembly: AssemblyFileVersion("1.5.4.0")]
[assembly: AssemblyInformationalVersion("1.5.4.0")]
[assembly: AssemblyVersion("1.5.5.0")]
[assembly: AssemblyFileVersion("1.5.5.0")]
[assembly: AssemblyInformationalVersion("1.5.5.0")]

#if DEBUG
[assembly: AssemblyConfiguration("Debug")]
Expand Down

0 comments on commit 8c86c61

Please sign in to comment.