@dotdev/harmony-sdk 1.26.1 → 1.27.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/dist/helpers/index.js +3 -11
- package/package.json +1 -1
package/dist/helpers/index.js
CHANGED
|
@@ -13,19 +13,11 @@ export class ApiHelper {
|
|
|
13
13
|
let response;
|
|
14
14
|
switch (type) {
|
|
15
15
|
case "GET":
|
|
16
|
-
response = await axiosInstance.get(url)
|
|
17
|
-
logger.error(error, `Error while sending request to ${endpoint} endpoint`);
|
|
18
|
-
throw error;
|
|
19
|
-
});
|
|
16
|
+
response = await axiosInstance.get(url);
|
|
20
17
|
break;
|
|
21
18
|
case "POST":
|
|
22
19
|
default:
|
|
23
|
-
response = await axiosInstance
|
|
24
|
-
.post(url, requestBody)
|
|
25
|
-
.catch((error) => {
|
|
26
|
-
logger.error(error, `Error while sending request to ${endpoint} endpoint`);
|
|
27
|
-
throw error;
|
|
28
|
-
});
|
|
20
|
+
response = await axiosInstance.post(url, requestBody);
|
|
29
21
|
break;
|
|
30
22
|
}
|
|
31
23
|
const logs = logger.child({
|
|
@@ -136,7 +128,7 @@ export class ApiHelper {
|
|
|
136
128
|
}
|
|
137
129
|
else {
|
|
138
130
|
logger.error(`Unexpected error occurred during API request`);
|
|
139
|
-
throw error;
|
|
131
|
+
throw JSON.stringify(error);
|
|
140
132
|
}
|
|
141
133
|
}
|
|
142
134
|
/**
|