@knime/hub-features 1.15.2 → 1.15.4
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
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @knime/hub-features
|
|
2
2
|
|
|
3
|
+
## 1.15.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e44c108: fix rfcErrors parser and return undefined on error
|
|
8
|
+
- Updated dependencies [e44c108]
|
|
9
|
+
- @knime/components@1.41.8
|
|
10
|
+
|
|
11
|
+
## 1.15.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [640ba04]
|
|
16
|
+
- @knime/components@1.41.7
|
|
17
|
+
|
|
3
18
|
## 1.15.2
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knime/hub-features",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.4",
|
|
4
4
|
"description": "Vue components & composables for shared hub features",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"lodash-es": "4.17.21",
|
|
37
37
|
"ofetch": "^1.4.1",
|
|
38
38
|
"typescript": "^5.8.3",
|
|
39
|
-
"@knime/components": "1.41.
|
|
39
|
+
"@knime/components": "1.41.8",
|
|
40
40
|
"@knime/styles": "1.14.3",
|
|
41
41
|
"@knime/utils": "1.7.1"
|
|
42
42
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type FetchOptions } from "ofetch";
|
|
2
2
|
|
|
3
3
|
import { type HubAvatarData, rfcErrors } from "@knime/hub-features";
|
|
4
4
|
import { VERSION_DEFAULT_LIMIT } from "@knime/hub-features/versions";
|
|
@@ -37,11 +37,7 @@ export const useVersionsApi = ({
|
|
|
37
37
|
|
|
38
38
|
return await $ofetch(path, { ...defaults, ...fetchOptions });
|
|
39
39
|
} catch (error) {
|
|
40
|
-
|
|
41
|
-
throw rfcErrors.tryParse(error);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
throw error;
|
|
40
|
+
throw rfcErrors.tryParse(error) ?? error;
|
|
45
41
|
}
|
|
46
42
|
};
|
|
47
43
|
|
package/src/rfcErrors/index.ts
CHANGED
|
@@ -35,21 +35,28 @@ const toToast = ({
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
38
|
+
* Parse an ofetch's `FetchError` to an `RFCError`.
|
|
39
|
+
* When parsing is not possible it returns undefined.
|
|
40
40
|
*/
|
|
41
|
-
const tryParse = (error:
|
|
41
|
+
const tryParse = (error: unknown): RFCError | undefined => {
|
|
42
|
+
if (!(error instanceof FetchError)) {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
|
|
42
46
|
if (!error.response) {
|
|
43
|
-
return
|
|
47
|
+
return undefined;
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
const responseDate = error.response.headers.get("date")
|
|
47
51
|
? new Date(error.response.headers.get("date")!)
|
|
48
52
|
: undefined;
|
|
49
53
|
|
|
54
|
+
const title =
|
|
55
|
+
typeof error.data === "string" ? error.data : error.data?.title ?? "";
|
|
56
|
+
|
|
50
57
|
const rfcErrorData: RFCErrorData = {
|
|
51
|
-
title:
|
|
52
|
-
details: error.data
|
|
58
|
+
title: title as string,
|
|
59
|
+
details: error.data?.details as string[] | undefined,
|
|
53
60
|
status: error.statusCode as number,
|
|
54
61
|
date: responseDate,
|
|
55
62
|
requestId: error.response.headers.get("x-request-id") ?? undefined,
|
|
@@ -284,10 +284,7 @@ export const useDownloadArtifact = (
|
|
|
284
284
|
} catch (error: unknown) {
|
|
285
285
|
// here only errors thrown by the initial requests are caught;
|
|
286
286
|
// errors occurring while polling will be handled in pollDownloadItem
|
|
287
|
-
|
|
288
|
-
throw rfcErrors.tryParse(error);
|
|
289
|
-
}
|
|
290
|
-
throw error;
|
|
287
|
+
throw rfcErrors.tryParse(error) ?? error;
|
|
291
288
|
}
|
|
292
289
|
};
|
|
293
290
|
|
|
@@ -287,11 +287,7 @@ export const useFileUpload = (options: UseFileUploadOptions = {}) => {
|
|
|
287
287
|
|
|
288
288
|
useUploadManagerResult.start(parentId, uploadPayload);
|
|
289
289
|
} catch (error) {
|
|
290
|
-
|
|
291
|
-
throw rfcErrors.tryParse(error);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
throw error;
|
|
290
|
+
throw rfcErrors.tryParse(error) ?? error;
|
|
295
291
|
} finally {
|
|
296
292
|
// errors can only be thrown in the prepareUpload call, useUploadManagerResult.start does its own error handling
|
|
297
293
|
prepareQueueSize.value -= enqueableFiles.length;
|