Skip to content

Commit

Permalink
Merge branch 'fix-tests'
Browse files Browse the repository at this point in the history
  • Loading branch information
m.tre committed Jun 26, 2024
2 parents 49bb09c + 562f352 commit 1e8a124
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public async Task Invoke_ShouldCatch_UnhandledExceptions()
public async Task Invoke_ShouldNotCatch_IgnoredUnhandledExceptions()
{
var result = await Client.GetAsync("canceled-bad-http-exception");

result.Response.Code.Should().Be(CanceledResponseCode);
}
#endif
Expand All @@ -55,11 +55,15 @@ protected override void SetupGlobal(IVostokAspNetCoreWebApplicationBuilder build
builder.SetupUnhandledExceptions(SetupUnhandledExceptions);
}
#endif

#if ASPNTCORE_HOSTING
protected override void SetupGlobal(Microsoft.AspNetCore.Builder.WebApplicationBuilder builder, Vostok.Hosting.AspNetCore.Web.Configuration.IVostokMiddlewaresConfigurator middlewaresConfigurator)
{
middlewaresConfigurator.ConfigureUnhandledExceptions(s => s.ErrorResponseCode = ResponseCode);
middlewaresConfigurator.ConfigureUnhandledExceptions(s =>
{
s.ErrorResponseCode = ResponseCode;
s.ExceptionsToIgnore.Add(typeof(BadHttpRequestException));
});
}
#endif

Expand Down

0 comments on commit 1e8a124

Please sign in to comment.