@tiledesk/tiledesk-tybot-connector 0.2.41 → 0.2.42
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
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
available on:
|
|
6
6
|
▶️ https://www.npmjs.com/package/@tiledesk/tiledesk-tybot-connector
|
|
7
7
|
|
|
8
|
+
# v0.2.42
|
|
9
|
+
- WebRequestV2 fix. Now you'll get the response payload (in the result) also on errors
|
|
10
|
+
|
|
8
11
|
# v0.2.41
|
|
9
12
|
- added attribute currentPhoneNumber
|
|
10
13
|
- added attribute tickeId
|
package/TiledeskExpression.js
CHANGED
package/package.json
CHANGED
|
@@ -226,6 +226,7 @@ class DirWebRequestV2 {
|
|
|
226
226
|
axios(axios_options)
|
|
227
227
|
.then((res) => {
|
|
228
228
|
if (this.log) {
|
|
229
|
+
console.log("Success Response:", res);
|
|
229
230
|
console.log("Response for url:", options.url);
|
|
230
231
|
console.log("Response headers:\n", JSON.stringify(res.headers));
|
|
231
232
|
}
|
|
@@ -250,6 +251,9 @@ class DirWebRequestV2 {
|
|
|
250
251
|
})
|
|
251
252
|
.catch( (err) => {
|
|
252
253
|
if (this.log) {
|
|
254
|
+
if (err.response) {
|
|
255
|
+
console.log("Error Response data:", err.response.data);
|
|
256
|
+
}
|
|
253
257
|
// FIX THE STRINGIFY OF CIRCULAR STRUCTURE BUG - START
|
|
254
258
|
let cache = [];
|
|
255
259
|
let error_log = JSON.stringify(err, function(key, value) { // try to use a separate function
|
|
@@ -285,10 +289,14 @@ class DirWebRequestV2 {
|
|
|
285
289
|
if (error.message) {
|
|
286
290
|
errorMessage = error.message;
|
|
287
291
|
}
|
|
292
|
+
let data = null;
|
|
293
|
+
if (err.response) {
|
|
294
|
+
data = err.response.data;
|
|
295
|
+
}
|
|
288
296
|
callback(
|
|
289
297
|
null, {
|
|
290
298
|
status: status,
|
|
291
|
-
data:
|
|
299
|
+
data: data,
|
|
292
300
|
error: errorMessage
|
|
293
301
|
}
|
|
294
302
|
);
|