< Summary - ZhEaIsNsAaBn.Libraries coverage (affected: 23 packages)

Information
Class: ZhEaIsNsAaBn.Utilities.APIExceptionHandlers.FallbackExceptionHandler
Assembly: ZhEaIsNsAaBn.Utilities.APIExceptionHandlers
File(s): /home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/UtilitiesPackages/ZhEaIsNsAaBn.Utilities.APIExceptionHandlers/GlobalHandlers/FallbackExceptionHandler.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 31
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
TryHandleAsync()100%11100%

File(s)

/home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/UtilitiesPackages/ZhEaIsNsAaBn.Utilities.APIExceptionHandlers/GlobalHandlers/FallbackExceptionHandler.cs

#LineLine coverage
 1using Microsoft.Extensions.Options;
 2
 3namespace ZhEaIsNsAaBn.Utilities.APIExceptionHandlers;
 4
 5/// <summary>
 6/// Handles every exception the other handlers didn't, with <see cref="Error.Unknown"/> (default 500). <c>Build()</c> al
 7/// </summary>
 8public sealed class FallbackExceptionHandler : BaseExceptionHandler<FallbackExceptionHandler>, IExceptionHandler
 9{
 10    /// <summary>Creates the handler.</summary>
 11    /// <param name="logger">The logger.</param>
 12    /// <param name="environment">The host environment.</param>
 13    /// <param name="settings">The status mapping.</param>
 14    public FallbackExceptionHandler( ILogger<FallbackExceptionHandler> logger, IWebHostEnvironment environment, IOptions
 19215        : base( logger, environment, settings ) { }
 16
 17
 18    /// <inheritdoc />
 19    public async ValueTask<bool> TryHandleAsync( HttpContext httpContext, Exception exception, CancellationToken cancell
 20    {
 2121        ArgumentNullException.ThrowIfNull( httpContext );
 2122        ArgumentNullException.ThrowIfNull( exception );
 23
 2124        Log.Unhandled( Logger, exception, httpContext.Request.Path, httpContext.Request.Method, httpContext.TraceIdentif
 25
 26
 2127        await GenerateError( httpContext, Error.Unknown( exception ), cancellationToken ).ConfigureAwait( false );
 28
 2129        return true;
 2130    }
 31}