Domain.Rejection reference
Rejection
Section titled “Rejection”Source:
packages/domain/src/Rejection.ts
A typed reason a command or read was refused. Nothing is recorded when a command is rejected, and the caller receives the rejection exactly as declared, through an Api too.
Rejection: Declaring rejections
Section titled “Rejection: Declaring rejections”import * as Domain from "@alchemy.run/domain";import * as Schema from "effect/Schema";
export class NotOpen extends Domain.Rejection("NotOpen") {}
export class InsufficientFunds extends Domain.Rejection("InsufficientFunds", { balance: Schema.Int, requested: Schema.Int,}) {}