| | | 1 | | /** |
| | | 2 | | * Base class for all domain-specific errors in the application. |
| | | 3 | | */ |
| | | 4 | | export class DomainError extends Error { |
| | | 5 | | constructor(message: string) { |
| | 35 | 6 | | super(message); |
| | 35 | 7 | | this.name = this.constructor.name; |
| | 35 | 8 | | Error.captureStackTrace(this, this.constructor); |
| | | 9 | | } |
| | | 10 | | } |
| | | 11 | | |
| | | 12 | | /** |
| | | 13 | | * Error thrown when required arguments are missing or invalid. |
| | | 14 | | */ |
| | | 15 | | export class InvalidArgumentError extends DomainError {} |
| | | 16 | | |
| | | 17 | | /** |
| | | 18 | | * Error thrown when a required dependency is missing. |
| | | 19 | | */ |
| | | 20 | | export class DependencyMissingError extends DomainError {} |
| | | 21 | | |
| | | 22 | | /** |
| | | 23 | | * Error thrown when a secret operation fails. |
| | | 24 | | */ |
| | | 25 | | export class SecretOperationError extends DomainError {} |
| | | 26 | | |
| | | 27 | | /** |
| | | 28 | | * Error thrown when an environment file operation fails. |
| | | 29 | | */ |
| | | 30 | | export class EnvironmentFileError extends DomainError {} |
| | | 31 | | |
| | | 32 | | /** |
| | | 33 | | * Error thrown when a parameter cannot be found. |
| | | 34 | | */ |
| | | 35 | | export class ParameterNotFoundError extends DomainError { |
| | | 36 | | constructor(paramName: string) { |
| | 0 | 37 | | super(`Parameter not found: ${paramName}`); |
| | 0 | 38 | | this.paramName = paramName; |
| | | 39 | | } |
| | | 40 | | |
| | | 41 | | readonly paramName: string; |
| | | 42 | | } |