@constructive-io/errors 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -59,7 +59,12 @@ python3 scripts/generate-registry.py
|
|
|
59
59
|
|
|
60
60
|
`audit-db-errors.py` scans every `EXCEPTION`/`THROW` across constructive-db deploy
|
|
61
61
|
sources and generated output and writes `scripts/db-error-inventory.json` (the
|
|
62
|
-
committed audit snapshot).
|
|
62
|
+
committed audit snapshot). It also captures the authoritative `public`/`internal`
|
|
63
|
+
class from each canonical `errors.raise_error('CODE', context, 'class')` call — the
|
|
64
|
+
database is the source of truth for classification, so an explicit class is trusted
|
|
65
|
+
directly; codes without one (e.g. single-arg calls relying on the helper default, or
|
|
66
|
+
legacy `RAISE EXCEPTION`) fall back to a name-based heuristic.
|
|
67
|
+
`generate-registry.py` reads that snapshot and, when a
|
|
63
68
|
`constructive-io/dashboard` checkout is found (via `DASHBOARD_DIR` or a sibling
|
|
64
69
|
`../dashboard`), seeds public copy from its error catalogs. Re-run both whenever
|
|
65
70
|
constructive-db error codes change. Never hand-edit the generated file.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GENERATED FILE — DO NOT EDIT BY HAND.
|
|
3
3
|
*
|
|
4
|
-
* Source of truth: the constructive-db error audit (
|
|
4
|
+
* Source of truth: the constructive-db error audit (520 distinct codes
|
|
5
5
|
* raised via EXCEPTION/THROW across deploy sources + generated output).
|
|
6
6
|
* Regenerate with `python3 scripts/generate-registry.py` (see README.md).
|
|
7
7
|
*
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* codes carry their raw message (with %-args rendered as {{argN}}). Curated
|
|
10
10
|
* entries in `registry.ts` override anything here (typed context + refined copy).
|
|
11
11
|
*
|
|
12
|
-
* Counts:
|
|
12
|
+
* Counts: 520 total, 385 public, 135 internal.
|
|
13
13
|
*/
|
|
14
14
|
import { type DefinedError } from '../define';
|
|
15
15
|
import type { ErrorContext } from '../types';
|
|
@@ -24,4 +24,4 @@ export declare const generatedRegistry: Record<string, DefinedError<ErrorContext
|
|
|
24
24
|
/** Audit metadata for each generated code. */
|
|
25
25
|
export declare const GENERATED_CODE_META: Record<string, GeneratedCodeMeta>;
|
|
26
26
|
/** Total number of codes collected from constructive-db. */
|
|
27
|
-
export declare const GENERATED_CODE_COUNT =
|
|
27
|
+
export declare const GENERATED_CODE_COUNT = 520;
|