cogsbox-shape
Version:
A TypeScript library for creating type-safe database schemas with Zod validation, SQL type definitions, and automatic client/server transformations. Unifies client, server, and database types through a single schema definition, with built-in support for r
15 lines (14 loc) • 405 B
JavaScript
export class RecordNotFoundError extends Error {
constructor(table, pk) {
super(`Record not found in "${table}" with pk: ${JSON.stringify(pk)}`);
this.name = "RecordNotFoundError";
}
}
export class ValidationError extends Error {
issues;
constructor(issues) {
super("Validation failed");
this.name = "ValidationError";
this.issues = issues;
}
}