rama creada apartir de master en j

This commit is contained in:
jrojas
2026-06-26 10:29:23 +02:00
parent 319fd3dfb0
commit c1517fda87
2810 changed files with 1927392 additions and 25392 deletions
@@ -1,3 +1,7 @@
namespace adas_core.Application.Exceptions;
/// <summary>
/// Represents errors that occur during API request processing, wrapping a descriptive message.
/// </summary>
/// <param name="message">The message that describes the error.</param>
public class ApiRequestException(string message) : Exception($"Api request exception: {message}");
@@ -2,12 +2,24 @@
namespace adas_core.Application.Exceptions;
/// <summary>
/// Represents an exception that is thrown when a bad or invalid request is received.
/// It serves as a specialized error type derived from the base <see cref="Exception"/> class for signaling client-side request failures.
/// </summary>
public class BadRequestException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="BadRequestException"/> class with a specified error message.
/// </summary>
/// <param name="message">The error message defined in <see cref="HttpEnum.ErrorMessage"/> that describes the reason for the exception.</param>
public BadRequestException(HttpEnum.ErrorMessage message) : base(((int)message).ToString())
{
}
/// <summary>
/// Initializes a new instance of the <see cref="BadRequestException"/> class with a specified error message.
/// </summary>
/// <param name="message">The error message that describes the reason for the exception.</param>
public BadRequestException(string message) : base(message)
{
}
@@ -2,12 +2,23 @@
namespace adas_core.Application.Exceptions;
/// <summary>
/// Represents an exception that is thrown when a conflict is encountered, such as a resource state mismatch or a duplicate entry.
/// </summary>
public class ConflictException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="ConflictException"/> class with a specified error message.
/// </summary>
/// <param name="message">The error message that describes the conflict.</param>
public ConflictException(HttpEnum.ErrorMessage message) : base(((int)message).ToString())
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ConflictException"/> class with a specified error message.
/// </summary>
/// <param name="message">The message that describes the error.</param>
public ConflictException(string message) : base(message)
{
}
@@ -2,12 +2,26 @@
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)
{
}
@@ -2,12 +2,26 @@
namespace adas_core.Application.Exceptions;
/// <summary>
/// Represents an exception that is thrown when an operation is forbidden or access to a resource is denied.
/// </summary>
/// <remarks>
/// This exception is intended to signal that a requested action violates access rules or restrictions, allowing callers to handle forbidden scenarios distinctly from other error conditions.
/// </remarks>
public class ForbbidenException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="ForbbidenException"/> class with a specified error message from the <see cref="HttpEnum.ErrorMessage"/> enumeration.
/// </summary>
/// <param name="message">The <see cref="HttpEnum.ErrorMessage"/> enumeration value whose integer representation is used as the exception message.</param>
public ForbbidenException(HttpEnum.ErrorMessage message) : base(((int)message).ToString())
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ForbbidenException"/> class with a specified error message.
/// </summary>
/// <param name="message">The message that describes the error.</param>
public ForbbidenException(string message) : base(message)
{
}
@@ -2,12 +2,23 @@
namespace adas_core.Application.Exceptions;
/// <summary>
/// Represents the exception that is thrown when data is encountered in a format that is not valid or expected.
/// </summary>
public class InvalidFormatException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="InvalidFormatException"/> class with a specified error message.
/// </summary>
/// <param name="message">The error message that describes the reason for the exception.</param>
public InvalidFormatException(HttpEnum.ErrorMessage message) : base(((int)message).ToString())
{
}
/// <summary>
/// Initializes a new instance of the <see cref="InvalidFormatException"/> class with a specified error message.
/// </summary>
/// <param name="message">The error message that describes the reason for the exception.</param>
public InvalidFormatException(string message) : base(message)
{
}
@@ -2,17 +2,31 @@
namespace adas_core.Application.Exceptions;
/// <summary>
/// Represents an exception that is thrown when a requested resource or item cannot be found.
/// </summary>
public class NotFoundException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="NotFoundException"/> class.
/// </summary>
public NotFoundException()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="NotFoundException"/> class with a specified error message.
/// </summary>
/// <param name="message">The message that describes the error.</param>
public NotFoundException(HttpEnum.ErrorMessage message) : base(((int)message).ToString())
{
}
/// <summary>
/// Initializes a new instance of the <see cref="NotFoundException"/> class with a specified error message.
/// </summary>
/// <param name="message">The message that describes the error.</param>
public NotFoundException(string message) : base(message)
{
}
}
}
@@ -1,3 +1,7 @@
namespace adas_core.Application.Exceptions;
/// <summary>
/// Represents an exception that is thrown when a token-related error occurs.
/// </summary>
/// <param name="message">The message that describes the error.</param>
public class TokenException(string message) : Exception(message);
@@ -2,12 +2,23 @@
namespace adas_core.Application.Exceptions;
/// <summary>
/// Exception thrown when a user lacks authorization to perform an operation.
/// </summary>
public class UnauthorizedException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="UnauthorizedException"/> class.
/// </summary>
/// <param name="message">The error message associated with the exception.</param>
public UnauthorizedException(HttpEnum.ErrorMessage message) : base(((int)message).ToString())
{
}
/// <summary>
/// Initializes a new instance of the <see cref="UnauthorizedException"/> class.
/// </summary>
/// <param name="message">The message that describes the error.</param>
public UnauthorizedException(string message) : base(message)
{
}
@@ -2,13 +2,27 @@
namespace adas_core.Application.Exceptions;
/// <summary>
/// Represents an exception that is thrown when an entity cannot be processed due to issues with its content or structure.
/// </summary>
/// <remarks>
/// This exception is typically used to signal that a request or entity was understood but could not be processed, similar to the semantics of an HTTP 422 (Unprocessable Entity) response.
/// </remarks>
public class UnprocessableEntityException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="UnprocessableEntityException"/> class with a specified error message enum.
/// </summary>
/// <param name="message">The error message enum containing the error code.</param>
public UnprocessableEntityException(HttpEnum.ErrorMessage message) : base(((int)message).ToString())
{
}
/// <summary>
/// Initializes a new instance of the <see cref="UnprocessableEntityException"/> class with a specified error message.
/// </summary>
/// <param name="message">The message that describes the error.</param>
public UnprocessableEntityException(string message) : base(message)
{
}
}
}