< Summary

Information
Class: AmbientServices.Utilities.ExceptionUtilities
Assembly: AmbientServices
File(s): /home/runner/work/AmbientServices/AmbientServices/AmbientServices/Utilities/ExceptionUtilities.cs
Tag: 332_35464845198
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 26
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
BuildFilteredString(...)100%44100%

File(s)

/home/runner/work/AmbientServices/AmbientServices/AmbientServices/Utilities/ExceptionUtilities.cs

#LineLine coverage
 1using System;
 2using System.Text;
 3
 4namespace AmbientServices.Utilities;
 5
 6/// <summary>
 7/// A static class that contains utilities for <see cref="System.Exception"/>.
 8/// </summary>
 9/// <remarks>
 10/// <pitch>The rendering engine behind <see cref="AmbientServices.Extensions.ExceptionExtensions"/>: builds the filtered
 11/// <pledge>Inner exceptions render before the exceptions that wrap them, separated by blank lines; each renders as the 
 12/// </remarks>
 13internal static class ExceptionUtilities
 14{
 15    internal static void BuildFilteredString(Exception exception, StringBuilder output)
 16    {
 217        Exception? innerException = exception.InnerException;
 218        if (innerException != null) BuildFilteredString(innerException, output);
 19
 220        if (output.Length > 0) output.AppendLine();
 21
 222        output.AppendFormat(System.Globalization.CultureInfo.InvariantCulture, "[{0}] {1}", exception.GetType().Name, ex
 223        output.AppendLine();
 224        output.Append(new FilteredStackTrace(exception));
 225    }
 26}