ti2-ventrata 1.0.21 → 1.0.22
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/index.js +6 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -52,9 +52,13 @@ class Plugin {
|
|
|
52
52
|
const pluginObj = this;
|
|
53
53
|
this.axios = async (...args) => axiosRaw(...args).catch(err => {
|
|
54
54
|
const errMsg = R.path(['response', 'data', 'errorMessage'], err);
|
|
55
|
-
console.log(
|
|
55
|
+
console.log(`error in ${this.name}`, args[0], errMsg || err);
|
|
56
56
|
if (pluginObj.events) {
|
|
57
|
-
pluginObj.events.emit(`${this.name}.axios.error`, {
|
|
57
|
+
pluginObj.events.emit(`${this.name}.axios.error`, {
|
|
58
|
+
request: args[0],
|
|
59
|
+
err: JSON.parse(JSON.stringify(err)),
|
|
60
|
+
errMsg,
|
|
61
|
+
});
|
|
58
62
|
}
|
|
59
63
|
if (errMsg) throw new Error(errMsg);
|
|
60
64
|
throw err;
|