| | | 1 | | namespace Allyaria.Abstractions.Exceptions; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// Represents errors that occur when a method call is invalid for the object's current state. This exception extends |
| | | 5 | | /// <see cref="AryException" /> to maintain Allyaria-specific exception handling semantics and ensure consistent error |
| | | 6 | | /// reporting across the application. |
| | | 7 | | /// </summary> |
| | | 8 | | public sealed class AryInvalidOperationException : AryException |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// Initializes a new instance of the <see cref="AryInvalidOperationException" /> class with an optional message, er |
| | | 12 | | /// code, and inner exception. |
| | | 13 | | /// </summary> |
| | | 14 | | /// <param name="message">A localized error message that describes the reason for the invalid operation.</param> |
| | | 15 | | /// <param name="errorCode"> |
| | | 16 | | /// An optional structured error code identifying the invalid operation category. Defaults to |
| | | 17 | | /// <c>"ARY.INVALID_OPERATION"</c> when <see langword="null" /> or empty. |
| | | 18 | | /// </param> |
| | | 19 | | /// <param name="innerException"> |
| | | 20 | | /// The underlying exception that caused the current exception, or <see langword="null" /> if |
| | | 21 | | /// none. |
| | | 22 | | /// </param> |
| | | 23 | | public AryInvalidOperationException(string? message = null, |
| | | 24 | | string? errorCode = null, |
| | | 25 | | Exception? innerException = null) |
| | 20 | 26 | | : base( |
| | 20 | 27 | | message: message, |
| | 20 | 28 | | errorCode: errorCode.OrDefaultIfEmpty(defaultValue: "ARY.INVALID_OPERATION"), |
| | 20 | 29 | | innerException: innerException |
| | 40 | 30 | | ) { } |
| | | 31 | | } |