@secrecy/lib 1.75.3 → 1.75.5
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/dist/lib/client/data-link.js +14 -1
- package/package.json +1 -1
|
@@ -39,10 +39,23 @@ export async function downloadDataFromLink(opts) {
|
|
|
39
39
|
console.error(err);
|
|
40
40
|
throw new Error(`Unable to fetch "${`${dataUrl}${opts.dataLinkSlug}/json"`}`, { cause: err });
|
|
41
41
|
});
|
|
42
|
-
const rawDataLink = await rawDataLinkRes.json().catch((err) => {
|
|
42
|
+
// const rawDataLink = await rawDataLinkRes.json().catch((err) => {
|
|
43
|
+
// console.error(err)
|
|
44
|
+
// throw new Error('Unable to parse data link json!', { cause: err })
|
|
45
|
+
// })
|
|
46
|
+
const rawDataLinkText = await rawDataLinkRes.text().catch((err) => {
|
|
43
47
|
console.error(err);
|
|
44
48
|
throw new Error('Unable to parse data link json!', { cause: err });
|
|
45
49
|
});
|
|
50
|
+
let rawDataLink = '';
|
|
51
|
+
try {
|
|
52
|
+
rawDataLink = JSON.parse(rawDataLinkText);
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
console.error(err);
|
|
56
|
+
console.log('rawDataLinkText:', rawDataLinkText);
|
|
57
|
+
throw new Error('Unable to parse data link json!', { cause: err });
|
|
58
|
+
}
|
|
46
59
|
const dataLink = downloadDataLinkSchema.safeParse(rawDataLink);
|
|
47
60
|
if (dataLink.error) {
|
|
48
61
|
throw new Error(`Should not happen!`, { cause: dataLink.error });
|
package/package.json
CHANGED