@futdevpro/fsm-dynamo 1.20.85 → 1.20.86
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/build/_collections/utils/extract-error-message.util.d.ts +11 -6
- package/build/_collections/utils/extract-error-message.util.d.ts.map +1 -1
- package/build/_collections/utils/extract-error-message.util.js +8 -7
- package/build/_collections/utils/extract-error-message.util.js.map +1 -1
- package/package.json +1 -1
|
@@ -15,7 +15,11 @@ export interface DyFM_ExtractErrorMessage_Options {
|
|
|
15
15
|
fallback?: string;
|
|
16
16
|
/**
|
|
17
17
|
* When `true`, the returned string includes HTTP status + statusText after
|
|
18
|
-
* the main message (in parens) for HTTP errors. Default: `
|
|
18
|
+
* the main message (in parens) for HTTP errors. Default: `false` — the
|
|
19
|
+
* result is shown to USERS, and a status code is technical detail: measured
|
|
20
|
+
* 2026-09-24, the shared login form showed "Login: … (HTTP 401)" on 5 TEST
|
|
21
|
+
* projects. The status stays in the raw error (the form-error panel's copy
|
|
22
|
+
* chain, the component / API-service log). Opt in for diagnostic surfaces.
|
|
19
23
|
*/
|
|
20
24
|
includeHttpStatus?: boolean;
|
|
21
25
|
}
|
|
@@ -42,9 +46,9 @@ export interface DyFM_ExtractErrorMessage_Options {
|
|
|
42
46
|
* resort, prefixed with 'Malformed error: '
|
|
43
47
|
* 11. `options.fallback` (or its default)
|
|
44
48
|
*
|
|
45
|
-
*
|
|
46
|
-
* HttpErrorResponse, the status + statusText are appended in
|
|
47
|
-
* `'Bad credentials (HTTP 401 Unauthorized)'`.
|
|
49
|
+
* Only when `includeHttpStatus: true` (opt-in, default `false`) and the input
|
|
50
|
+
* looks like a HttpErrorResponse, the status + statusText are appended in
|
|
51
|
+
* parens: e.g. `'Bad credentials (HTTP 401 Unauthorized)'`.
|
|
48
52
|
*
|
|
49
53
|
* @example
|
|
50
54
|
* ```ts
|
|
@@ -52,7 +56,7 @@ export interface DyFM_ExtractErrorMessage_Options {
|
|
|
52
56
|
* await auth_CS.login(account);
|
|
53
57
|
* } catch (err) {
|
|
54
58
|
* this.formError = DyFM_extractErrorMessage(err, { prefix: 'Login' });
|
|
55
|
-
* // → 'Login: Bad credentials
|
|
59
|
+
* // → 'Login: Bad credentials' (the raw `err` keeps the status for the log / copy chain)
|
|
56
60
|
* // OR
|
|
57
61
|
* // → 'Login: Network unreachable — check connection. Server logs may have detail.'
|
|
58
62
|
* // never 'Login: undefined undefined'
|
|
@@ -63,7 +67,8 @@ export declare function DyFM_extractErrorMessage(err: DyFM_AnyError | unknown, o
|
|
|
63
67
|
/**
|
|
64
68
|
* Convenience: same as DyFM_extractErrorMessage but always includes a default
|
|
65
69
|
* prefix derived from the calling context, useful for adding diagnostic
|
|
66
|
-
* breadcrumbs without per-call boilerplate.
|
|
70
|
+
* breadcrumbs without per-call boilerplate. Diagnostic ⇒ it keeps the HTTP
|
|
71
|
+
* status (`includeHttpStatus: true`) — do not show its result to users.
|
|
67
72
|
*/
|
|
68
73
|
export declare function DyFM_formatError(err: DyFM_AnyError | unknown, prefix: string): string;
|
|
69
74
|
export declare function DyFM_registerMalformedErrorSink(fn: (err: unknown, context?: string) => void): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-error-message.util.d.ts","sourceRoot":"","sources":["../../../src/_collections/utils/extract-error-message.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAc,MAAM,kDAAkD,CAAC;AAG7F;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB
|
|
1
|
+
{"version":3,"file":"extract-error-message.util.d.ts","sourceRoot":"","sources":["../../../src/_collections/utils/extract-error-message.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAc,MAAM,kDAAkD,CAAC;AAG7F;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,aAAa,GAAG,OAAO,EAC5B,OAAO,CAAC,EAAE,gCAAgC,GACzC,MAAM,CA2DR;AAqCD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,aAAa,GAAG,OAAO,EAC5B,MAAM,EAAE,MAAM,GACb,MAAM,CAER;AAiBD,wBAAgB,+BAA+B,CAC7C,EAAE,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,GAC3C,IAAI,CAEN;AAED,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,OAAO,EACZ,OAAO,CAAC,EAAE,MAAM,GACf,IAAI,CAmBN"}
|
|
@@ -27,9 +27,9 @@ exports.DyFM_reportMalformedError = DyFM_reportMalformedError;
|
|
|
27
27
|
* resort, prefixed with 'Malformed error: '
|
|
28
28
|
* 11. `options.fallback` (or its default)
|
|
29
29
|
*
|
|
30
|
-
*
|
|
31
|
-
* HttpErrorResponse, the status + statusText are appended in
|
|
32
|
-
* `'Bad credentials (HTTP 401 Unauthorized)'`.
|
|
30
|
+
* Only when `includeHttpStatus: true` (opt-in, default `false`) and the input
|
|
31
|
+
* looks like a HttpErrorResponse, the status + statusText are appended in
|
|
32
|
+
* parens: e.g. `'Bad credentials (HTTP 401 Unauthorized)'`.
|
|
33
33
|
*
|
|
34
34
|
* @example
|
|
35
35
|
* ```ts
|
|
@@ -37,7 +37,7 @@ exports.DyFM_reportMalformedError = DyFM_reportMalformedError;
|
|
|
37
37
|
* await auth_CS.login(account);
|
|
38
38
|
* } catch (err) {
|
|
39
39
|
* this.formError = DyFM_extractErrorMessage(err, { prefix: 'Login' });
|
|
40
|
-
* // → 'Login: Bad credentials
|
|
40
|
+
* // → 'Login: Bad credentials' (the raw `err` keeps the status for the log / copy chain)
|
|
41
41
|
* // OR
|
|
42
42
|
* // → 'Login: Network unreachable — check connection. Server logs may have detail.'
|
|
43
43
|
* // never 'Login: undefined undefined'
|
|
@@ -45,7 +45,7 @@ exports.DyFM_reportMalformedError = DyFM_reportMalformedError;
|
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
47
|
function DyFM_extractErrorMessage(err, options) {
|
|
48
|
-
const includeHttpStatus = options?.includeHttpStatus
|
|
48
|
+
const includeHttpStatus = options?.includeHttpStatus === true;
|
|
49
49
|
const fallback = options?.fallback
|
|
50
50
|
?? 'Unexpected error (no detail in payload — check server logs).';
|
|
51
51
|
const prefix = options?.prefix ? `${options.prefix}: ` : '';
|
|
@@ -140,10 +140,11 @@ function _safeJsonStringify(v) {
|
|
|
140
140
|
/**
|
|
141
141
|
* Convenience: same as DyFM_extractErrorMessage but always includes a default
|
|
142
142
|
* prefix derived from the calling context, useful for adding diagnostic
|
|
143
|
-
* breadcrumbs without per-call boilerplate.
|
|
143
|
+
* breadcrumbs without per-call boilerplate. Diagnostic ⇒ it keeps the HTTP
|
|
144
|
+
* status (`includeHttpStatus: true`) — do not show its result to users.
|
|
144
145
|
*/
|
|
145
146
|
function DyFM_formatError(err, prefix) {
|
|
146
|
-
return DyFM_extractErrorMessage(err, { prefix: prefix });
|
|
147
|
+
return DyFM_extractErrorMessage(err, { prefix: prefix, includeHttpStatus: true });
|
|
147
148
|
}
|
|
148
149
|
/**
|
|
149
150
|
* Reports a raw error payload via the universal client-error capture system
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-error-message.util.js","sourceRoot":"","sources":["../../../src/_collections/utils/extract-error-message.util.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"extract-error-message.util.js","sourceRoot":"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A+B,CAC7C,EAA4C;IAE5C,mBAAmB,GAAG,EAAE,CAAC;AAC3B,CAAC;AAED,SAAgB,yBAAyB,CACvC,GAAY,EACZ,OAAgB;IAEhB,IAAI,mBAAmB,KAAK,SAAS,EAAE,CAAC;QACtC,IAAI,CAAC;YACH,mBAAmB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YAClC,OAAO;QACT,CAAC;QAAC,MAAM,CAAC;YACP,0CAA0C;QAC5C,CAAC;IACH,CAAC;IACD,8EAA8E;IAC9E,IAAI,CAAC;QACH,8EAA8E;QAC9E,MAAM,EAAE,QAAQ,EAAE,GAChB,OAAO,CAAC,YAAY,CAAC,CAAC;QACxB,QAAQ,CAAC,KAAK,CAAC,+BAA+B,OAAO,IAAI,iBAAiB,EAAE,EAAE,GAAG,CAAC,CAAC;IACrF,CAAC;IAAC,MAAM,CAAC;QACP,uEAAuE;QACvE,aAAa;IACf,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@futdevpro/fsm-dynamo",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.86",
|
|
4
4
|
"description": "Full Stack Model Collection for Dynamic (NodeJS-Typescript) Framework called Dynamo, by Future Development Ltd.",
|
|
5
5
|
"DyBu_settings": {
|
|
6
6
|
"packageType": "full-stack-package",
|