| title | ARC0012: Built-in error thrown from an artifact |
|---|---|
| description | Resolve ARC0012 in Arc TypeScript by replacing built-in errors thrown from commands, validators or read models with named domain error types. |
A decorated command, validator, or read model throws new Error (or another built-in error). Rule: arc-core/arc0012.
A domain-named error identifies the failure in logs and direct calls. This checks throw new ..., not indirect calls or imported aliases.
@command()
export class Register { handle() { throw new Error('Already registered'); } }@command()
export class Register { handle() { throw new AlreadyRegistered(); } }