Files
adas-core/adas-core.Application/Exceptions/CustomArgumentException.cs
T

31 lines
1.3 KiB
C#

using adas_core.Domain.Enums;
namespace adas_core.Application.Exceptions;
/// <summary>
/// Represents a custom exception that is thrown when one or more arguments provided to a method are invalid.
/// </summary>
/// <remarks>
/// This exception extends the base <see cref="Exception"/> class to provide a domain-specific error type for argument validation failures.
/// </remarks>
/// <!-- aidoc:v1 sig=434a4a5 -->
public class CustomArgumentException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="CustomArgumentException"/> class with the specified error message.
/// </summary>
/// <param name="message">The error message from the <see cref="HttpEnum.ErrorMessage"/> enumeration.</param>
/// <!-- aidoc:v1 sig=9c6bb9a body=4448e1d -->
public CustomArgumentException(HttpEnum.ErrorMessage message) : base(((int)message).ToString())
{
}
/// <summary>
/// Initializes a new instance of the <see cref="CustomArgumentException"/> class with a specified error message.
/// </summary>
/// <param name="message">The error message that describes the reason for the exception.</param>
/// <!-- aidoc:v1 sig=cee336d body=4448e1d -->
public CustomArgumentException(string message) : base(message)
{
}
}