< Summary - Kestrun — Combined Coverage

Information
Class: Kestrun.Logging.Exceptions.WrapperException
Assembly: Kestrun
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Logging/Exceptions/WrapperException.cs
Tag: Kestrun/Kestrun@9d3a582b2d63930269564a7591aa77ef297cadeb
Line coverage
22%
Covered lines: 2
Uncovered lines: 7
Coverable lines: 9
Total lines: 51
Line coverage: 22.2%
Branch coverage
0%
Covered branches: 0
Total branches: 4
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_ErrorRecordWrapper()100%11100%
.ctor(...)100%210%
.ctor(...)100%210%
.ctor(...)100%11100%
.ctor()100%210%
ToString()0%2040%

File(s)

/home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Logging/Exceptions/WrapperException.cs

#LineLine coverage
 1using System.Management.Automation;
 2using Kestrun.Logging.Data;
 3
 4namespace Kestrun.Logging.Exceptions;
 5
 6/// <summary>
 7/// Represents an exception that wraps another exception and optionally an ErrorRecord.
 8/// </summary>
 9public class WrapperException : Exception
 10{
 11    /// <summary>
 12    /// Gets the wrapped <see cref="ErrorRecordWrapper"/> associated with this exception, if any.
 13    /// </summary>
 414    public ErrorRecordWrapper? ErrorRecordWrapper { get; }
 15
 16    /// <summary>
 17    /// Initializes a new instance of the <see cref="WrapperException"/> class with a specified error message.
 18    /// </summary>
 19    /// <param name="message">The error message that explains the reason for the exception.</param>
 020    public WrapperException(string message) : base(message)
 21    {
 022    }
 23
 24    /// <summary>
 25    /// Initializes a new instance of the <see cref="WrapperException"/> class with a specified error message and a refe
 26    /// </summary>
 27    /// <param name="message">The error message that explains the reason for the exception.</param>
 28    /// <param name="innerException">The exception that is the cause of the current exception.</param>
 029    public WrapperException(string message, Exception innerException) : base(message, innerException)
 30    {
 031    }
 32
 33    /// <summary>
 34    /// Initializes a new instance of the <see cref="WrapperException"/> class with a specified inner exception and an <
 35    /// </summary>
 36    /// <param name="innerException">The exception that is the cause of the current exception.</param>
 37    /// <param name="errorRecord">The <see cref="ErrorRecord"/> associated with this exception.</param>
 438    public WrapperException(Exception innerException, ErrorRecord errorRecord) : base(string.Empty, innerException) => E
 39
 40    /// <summary>
 41    /// Initializes a new instance of the <see cref="WrapperException"/> class.
 42    /// </summary>
 043    public WrapperException()
 44    {
 045    }
 46
 47    /// <summary>
 48    /// Returns a string representation of the inner exception, or an empty string if none exists.
 49    /// </summary>
 050    public override string ToString() => InnerException?.ToString() ?? string.Empty;
 51}