@friggframework/core 2.0.0-next.113 → 2.0.0-next.114
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/errors/fetch-error.js +12 -1
- package/package.json +5 -5
package/errors/fetch-error.js
CHANGED
|
@@ -12,10 +12,21 @@ function resourceUrl(resource) {
|
|
|
12
12
|
return redactUrl(resource);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
// node-fetch messages can contain part of the response body.
|
|
16
|
+
// Use a fixed phrase instead of the original message.
|
|
17
|
+
const NODE_FETCH_TYPE_PHRASES = {
|
|
18
|
+
'invalid-json': 'invalid json response body',
|
|
19
|
+
};
|
|
20
|
+
|
|
15
21
|
function causeLabel(cause) {
|
|
16
22
|
if (!cause || typeof cause !== 'object') return '';
|
|
17
23
|
const label = cause.code ?? cause.name;
|
|
18
|
-
|
|
24
|
+
const scrubbedLabel =
|
|
25
|
+
label === undefined || label === null ? '' : scrubString(String(label));
|
|
26
|
+
const phrase = Object.hasOwn(NODE_FETCH_TYPE_PHRASES, cause.type)
|
|
27
|
+
? NODE_FETCH_TYPE_PHRASES[cause.type]
|
|
28
|
+
: '';
|
|
29
|
+
return [scrubbedLabel, phrase].filter(Boolean).join(': ');
|
|
19
30
|
}
|
|
20
31
|
|
|
21
32
|
function buildMessage({ method, url, response, cause }) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/core",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0-next.
|
|
4
|
+
"version": "2.0.0-next.114",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@aws-sdk/client-apigatewaymanagementapi": "^3.588.0",
|
|
7
7
|
"@aws-sdk/client-kms": "^3.588.0",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@friggframework/eslint-config": "2.0.0-next.
|
|
51
|
-
"@friggframework/prettier-config": "2.0.0-next.
|
|
52
|
-
"@friggframework/test": "2.0.0-next.
|
|
50
|
+
"@friggframework/eslint-config": "2.0.0-next.114",
|
|
51
|
+
"@friggframework/prettier-config": "2.0.0-next.114",
|
|
52
|
+
"@friggframework/test": "2.0.0-next.114",
|
|
53
53
|
"@prisma/client": "^6.19.3",
|
|
54
54
|
"@types/lodash": "4.17.15",
|
|
55
55
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"publishConfig": {
|
|
90
90
|
"access": "public"
|
|
91
91
|
},
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "5e56fb857cb3cc0ccf9e033690ecb37cf3e6730c"
|
|
93
93
|
}
|