28 lines
1.1 KiB
C#
28 lines
1.1 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>
|
|
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>
|
|
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>
|
|
public CustomArgumentException(string message) : base(message)
|
|
{
|
|
}
|
|
} |