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.
14 lines
469 B
TypeScript
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)
|
|
}
|
|
}
|