@webpieces/rules-config 0.4.790 → 0.4.792
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpieces/rules-config",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.792",
|
|
4
4
|
"description": "Shared webpieces.config.json loader. Single source of truth for validation rule configuration consumed by @webpieces/ai-hook-rules, @webpieces/code-rules, and @webpieces/nx-webpieces-rules.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -657,7 +657,8 @@ async submitForm(): Promise<void> {
|
|
|
657
657
|
|
|
658
658
|
### `ApiEndUserError` is not a convention — it is the only message that survives the wire
|
|
659
659
|
|
|
660
|
-
This is a HARD RULE, enforced by `
|
|
660
|
+
This is a HARD RULE, enforced by `WebpiecesDefaultErrorTranslator.toWire` (`core-util`), which
|
|
661
|
+
`ExpressWrapper.handleError` calls on the server:
|
|
661
662
|
|
|
662
663
|
> **Only `ApiEndUserError`'s `message` is sent to the caller.** Every other `ApiError` subclass sends
|
|
663
664
|
> its generic semantic message — `'Not Found'`, `'Internal Error'`, … — and
|
|
@@ -672,8 +673,8 @@ external consumer. So:
|
|
|
672
673
|
text as `ApiBadRequestError`'s `callerMessage`, which IS sent (as `callerMessage`).
|
|
673
674
|
- A client must branch on the error TYPE, on `subType`, on `errorCode` or on `callerMessage` — never
|
|
674
675
|
on the prose of `message`. Against a current webpieces server that prose is a constant per status.
|
|
675
|
-
- An app that deliberately wants to publish richer text installs an `
|
|
676
|
-
`ClientRegistry` (`
|
|
676
|
+
- An app that deliberately wants to publish richer text installs an `ErrorTranslator` on
|
|
677
|
+
`ClientRegistry` (`setErrorTranslator`); its `toWire()` response — status, reason phrase, headers
|
|
677
678
|
and body — is sent verbatim. That is the explicit, greppable opt-out.
|
|
678
679
|
|
|
679
680
|
## How to Request Approval
|