DomainErrors
DomainErrors refers to a conceptual category of errors that arise within a specific problem domain or application. Unlike general programming errors like syntax errors or runtime exceptions, domain errors are tied to the rules, logic, and constraints of the business or application itself. For instance, in an e-commerce system, a domain error might occur if a user attempts to purchase more items than are available in stock, or if a discount code is applied that has already expired.
These errors are not necessarily bugs in the code's execution, but rather violations of expected business logic.
When a domain error occurs, the system should ideally signal this to the user or another part