Documentation modifications
This commit is contained in:
@@ -7,10 +7,22 @@ namespace adas_core.Domain.Exceptions;
|
||||
/// </summary>
|
||||
public class BusinessException : AggregateException
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BusinessException"/> class with the supplied <see cref="HttpStatusCode"/> and message, forwarding their combined textual representation to the base exception constructor. <see cref="BusinessException"/> represents errors raised by business logic that are associated with an HTTP status.
|
||||
/// </summary>
|
||||
/// <param name="status">The <see cref="HttpStatusCode"/> that identifies the nature of the business error.</param>
|
||||
/// <param name="message">The descriptive message that provides additional context for the error.</param>
|
||||
/// <!-- aidoc:v1 sig=0825145 body=4448e1d -->
|
||||
public BusinessException(HttpStatusCode status, string message) : base($"{status}: {message}")
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BusinessException"/> class, which represents errors in business logic, by passing the specified error message and inner <see cref="Exception"/> to the base class constructor.
|
||||
/// </summary>
|
||||
/// <param name="message">The error message that describes the reason for the exception.</param>
|
||||
/// <param name="exception">The inner <see cref="Exception"/> that is the cause of the current exception, or <see langword="null"/> if no inner exception is specified.</param>
|
||||
/// <!-- aidoc:v1 sig=cd57c0c body=4448e1d -->
|
||||
public BusinessException(string message, Exception exception) : base(message, exception)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -11,11 +11,22 @@ namespace adas_core.Domain.Exceptions;
|
||||
/// </remarks>
|
||||
public class LoginServicesException : BusinessException
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LoginServicesException"/> class with a descriptive error message, forwarding it to the base exception together with an HTTP <see cref="HttpStatusCode.BadRequest"/> status code.
|
||||
/// </summary>
|
||||
/// <param name="message">The error message that describes the login service failure.</param>
|
||||
/// <!-- aidoc:v1 sig=16739ff body=4448e1d -->
|
||||
public LoginServicesException(string message) :
|
||||
base(HttpStatusCode.BadRequest, $"Login service error: {message}")
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LoginServicesException"/> class, which represents errors that occur in the login service. The supplied <paramref name="message"/> is prefixed with a service-context note and the underlying <paramref name="exception"/> is preserved as the inner exception.
|
||||
/// </summary>
|
||||
/// <param name="message">The error message describing the login service failure.</param>
|
||||
/// <param name="exception">The inner <see cref="System.Exception"/> that caused the current exception.</param>
|
||||
/// <!-- aidoc:v1 sig=83e8d73 body=4448e1d -->
|
||||
public LoginServicesException(string message, Exception exception) : base($"Login service error: {message}",
|
||||
exception)
|
||||
{
|
||||
|
||||
@@ -2,5 +2,12 @@
|
||||
|
||||
namespace adas_core.Domain.Exceptions;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the exception that is thrown when no login services are available to handle authentication requests.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This exception derives from <see cref="BusinessException"/> and is raised with the <see cref="HttpStatusCode.Forbidden"/> status code and the message "No login services available".
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=e23ced3 -->
|
||||
public class LoginServicesNotFoundException()
|
||||
: BusinessException(HttpStatusCode.Forbidden, "No login services available");
|
||||
@@ -10,11 +10,22 @@ namespace adas_core.Domain.Exceptions;
|
||||
/// </remarks>
|
||||
public class UserNotFoundException : BusinessException
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UserNotFoundException"/> class with a <see cref="HttpStatusCode.NotFound"/> status code and a message identifying the missing <paramref name="username"/>.
|
||||
/// </summary>
|
||||
/// <param name="username">The username of the user that could not be found.</param>
|
||||
/// <!-- aidoc:v1 sig=3e9ae01 body=4448e1d -->
|
||||
public UserNotFoundException(string username) :
|
||||
base(HttpStatusCode.NotFound, $"USER with username {username} not found")
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UserNotFoundException"/> class with the username that could not be found and a wrapped inner <see cref="Exception"/>.
|
||||
/// </summary>
|
||||
/// <param name="username">The username that was not found.</param>
|
||||
/// <param name="exception">The inner <see cref="Exception"/> that caused this exception to be raised.</param>
|
||||
/// <!-- aidoc:v1 sig=2ed5f9f body=4448e1d -->
|
||||
public UserNotFoundException(string username, Exception exception) : base(
|
||||
$"USER with username {username} not found", exception)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user