@aloma.io/integration-sdk 3.3.6 → 3.3.8

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.
@@ -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
- return await ret.json();
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aloma.io/integration-sdk",
3
- "version": "3.3.6",
3
+ "version": "3.3.8",
4
4
  "description": "",
5
5
  "author": "aloma.io",
6
6
  "license": "Apache-2.0",
@@ -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
- return await ret.json();
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 {