@repo/errors provides the shared error model for the monorepo. It exports CircleError (an abstract base with code, domain, .with() context, and .toJSON()), plus UnhandledError, ValidationError, and EnvironmentVariableNotSetError.
graph TD
errors["@repo/errors"]
errors -.-> tsconfig["@repo/typescript-config"]
errors -.-> vitest["@repo/vitest-config"]import { CircleError, ValidationError } from "@repo/errors";
class PatientNotFoundError extends CircleError {
readonly code = "PATIENT_NOT_FOUND" as const;
readonly domain = "patients" as const;
}
const error = new PatientNotFoundError("No patient with that ID").with({
patientId: "abc-123",
});
| Script | Description |
|---|---|
check-types |
Runs tsc --noEmit to typecheck the package. |