@aloma.io/integration-sdk 3.3.5 → 3.3.7
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/internal/index.mjs
CHANGED
@@ -33,7 +33,13 @@ const unwrap = async (ret, options) => {
|
|
33
33
|
return await ret.text();
|
34
34
|
if (options?.base64)
|
35
35
|
return (await ret.buffer()).toString("base64");
|
36
|
-
|
36
|
+
const text = await ret.text();
|
37
|
+
try {
|
38
|
+
return JSON.parse(text);
|
39
|
+
}
|
40
|
+
catch (e) {
|
41
|
+
throw (e + ' ' + text);
|
42
|
+
}
|
37
43
|
};
|
38
44
|
class Fetcher {
|
39
45
|
constructor({ retry = 5, baseUrl, onResponse }) {
|
package/package.json
CHANGED
package/src/internal/index.mjs
CHANGED
@@ -40,8 +40,15 @@ const reply = (arg, packet, transport) => {
|
|
40
40
|
const unwrap = async (ret, options) => {
|
41
41
|
if (options?.text) return await ret.text();
|
42
42
|
if (options?.base64) return (await ret.buffer()).toString("base64");
|
43
|
-
|
44
|
-
|
43
|
+
|
44
|
+
const text = await ret.text();
|
45
|
+
|
46
|
+
try
|
47
|
+
{
|
48
|
+
return JSON.parse(text);
|
49
|
+
} catch(e) {
|
50
|
+
throw (e + ' ' + text)
|
51
|
+
}
|
45
52
|
};
|
46
53
|
|
47
54
|
class Fetcher {
|