< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Channels.Framing.TransportExceptionHandler
Assembly: CoreWCF.NetFramingBase
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.NetFramingBase/src/CoreWCF/Channels/Framing/TransportExceptionHandler.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 15
Coverable lines: 15
Total lines: 48
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 8
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
HandleTransportExceptionHelper(...)0%880%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.NetFramingBase/src/CoreWCF/Channels/Framing/TransportExceptionHandler.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System;
 5using System.Diagnostics;
 6using CoreWCF.Dispatcher;
 7using CoreWCF.Runtime;
 8
 9namespace CoreWCF.Channels.Framing
 10{
 11    internal class TransportExceptionHandler
 12    {
 13        internal static bool HandleTransportExceptionHelper(Exception exception)
 14        {
 015            if (exception == null)
 16            {
 017                throw Fx.AssertAndThrow("Null exception passed to HandleTransportExceptionHelper.");
 18            }
 19
 020            ExceptionHandler handler = ExceptionHandler.TransportExceptionHandler;
 021            if (handler == null)
 22            {
 023                return false;
 24            }
 25
 26            try
 27            {
 028                if (!handler.HandleException(exception))
 29                {
 030                    return false;
 31                }
 032            }
 33            catch (Exception thrownException)
 34            {
 035                if (Fx.IsFatal(thrownException))
 36                {
 037                    throw;
 38                }
 39
 040                DiagnosticUtility.TraceHandledException(thrownException, TraceEventType.Error);
 041                return false;
 42            }
 43
 044            DiagnosticUtility.TraceHandledException(exception, TraceEventType.Error);
 045            return true;
 046        }
 47    }
 48}