@knime/hub-features 1.22.0 → 1.22.1
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/CHANGELOG.md +6 -0
- package/package.json +3 -3
- package/src/rfcErrors/index.ts +11 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knime/hub-features",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.1",
|
|
4
4
|
"description": "Vue components & composables for shared hub features",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"lodash-es": "4.17.23",
|
|
37
37
|
"ofetch": "^1.4.1",
|
|
38
38
|
"typescript": "^5.9.3",
|
|
39
|
-
"@knime/components": "1.45.7",
|
|
40
39
|
"@knime/styles": "1.15.0",
|
|
41
|
-
"@knime/utils": "1.10.0"
|
|
40
|
+
"@knime/utils": "1.10.0",
|
|
41
|
+
"@knime/components": "1.45.7"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"consola": "3.x",
|
package/src/rfcErrors/index.ts
CHANGED
|
@@ -41,12 +41,22 @@ const toToast = ({
|
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
+
const isFetchError = (error: unknown): error is FetchError => {
|
|
45
|
+
return (
|
|
46
|
+
error !== null &&
|
|
47
|
+
typeof error === "object" &&
|
|
48
|
+
"response" in error &&
|
|
49
|
+
"statusCode" in error &&
|
|
50
|
+
"data" in error
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
44
54
|
/**
|
|
45
55
|
* Parse an ofetch's `FetchError` to an `RFCError`.
|
|
46
56
|
* When parsing is not possible it returns undefined.
|
|
47
57
|
*/
|
|
48
58
|
const tryParse = (error: unknown): RFCError | undefined => {
|
|
49
|
-
if (!(error
|
|
59
|
+
if (!isFetchError(error)) {
|
|
50
60
|
return undefined;
|
|
51
61
|
}
|
|
52
62
|
|