< Summary

Information
Class: Allyaria.Abstractions.Exceptions.AryArgumentException
Assembly: Allyaria.Abstractions
File(s): /home/runner/work/allyaria/allyaria/src/Allyaria.Abstractions/Exceptions/AryArgumentException.cs
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
Total lines: 49
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%
get_ArgName()100%11100%
get_ArgValue()100%11100%

File(s)

/home/runner/work/allyaria/allyaria/src/Allyaria.Abstractions/Exceptions/AryArgumentException.cs

#LineLine coverage
 1namespace Allyaria.Abstractions.Exceptions;
 2
 3/// <summary>
 4/// Represents errors that occur due to invalid or unexpected argument values. This exception extends
 5/// <see cref="AryException" /> to provide additional context about the argument name and value that caused the issue,
 6/// supporting Allyaria’s structured exception handling model.
 7/// </summary>
 8public sealed class AryArgumentException : AryException
 9{
 10    /// <summary>
 11    /// Initializes a new instance of the <see cref="AryArgumentException" /> class with optional message, argument name
 12    /// argument value, error code, and inner exception details.
 13    /// </summary>
 14    /// <param name="message">A localized message describing the nature of the argument error.</param>
 15    /// <param name="argName">The name of the argument that caused the exception. May be <see langword="null" />.</param
 16    /// <param name="argValue">The value of the argument that caused the exception. May be <see langword="null" />.</par
 17    /// <param name="errorCode">
 18    /// An optional structured error code identifying the type of argument error. Defaults to <c>"ARY.ARGUMENT"</c> when
 19    /// specified.
 20    /// </param>
 21    /// <param name="innerException">
 22    /// The exception that is the cause of the current exception, or <see langword="null" /> if
 23    /// none.
 24    /// </param>
 25    public AryArgumentException(string? message = null,
 26        string? argName = null,
 27        object? argValue = null,
 28        string? errorCode = null,
 29        Exception? innerException = null)
 36030        : base(
 36031            message: message,
 36032            errorCode: errorCode.OrDefaultIfEmpty(defaultValue: "ARY.ARGUMENT"),
 36033            innerException: innerException
 36034        )
 35    {
 36036        ArgName = argName;
 36037        ArgValue = argValue;
 36038    }
 39
 40    /// <summary>Gets the name of the argument that caused the exception.</summary>
 41    /// <value>A <see cref="string" /> representing the argument name, or <see langword="null" /> if not provided.</valu
 6442    public string? ArgName { get; }
 43
 44    /// <summary>Gets the value of the argument that caused the exception.</summary>
 45    /// <value>
 46    /// An <see cref="object" /> representing the problematic argument value, or <see langword="null" /> if not provided
 47    /// </value>
 4648    public object? ArgValue { get; }
 49}