teqo/src/utilities/entityNotFound.ts
Francisco Ignácio Fontoura Solla 4806c417c8 Engineering Pass 3: consolidate patterns and lock them with guards.
Fold duplicated campanha access, loaders, list/filter/form shells, and scripts into shared modules; reorganize utilities by domain; stabilize e2e; and document prevention-first audit workflow so the same smells cannot creep back in.
2026-07-29 06:11:29 -03:00

14 lines
469 B
TypeScript

/**
* The named "entity not found → 404" error machine (P3-F, 3rd call site):
* each domain loader throws its own class so pages can `instanceof`-catch and
* call `notFound()` — the class name and the pt-BR message are data, the
* machine is shared.
*/
export const createEntityNotFoundError = (entityName: string, message: string) =>
class extends Error {
override name = `${entityName}NotFoundError`
constructor() {
super(message)
}
}