notification-processor 4.19.2 → 4.19.3
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.
|
@@ -118,14 +118,13 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
118
118
|
job = _ref3.job,
|
|
119
119
|
partialMessage = _ref3.partialMessage;
|
|
120
120
|
|
|
121
|
-
var errorType, now, theRequest;
|
|
121
|
+
var errorMessage, errorType, now, theRequest;
|
|
122
122
|
if (!eventId) {
|
|
123
123
|
return Promise.resolve({});
|
|
124
124
|
}
|
|
125
125
|
theRequest = _.get(err, "detail.request") || _.get(err, "cause.detail.request");
|
|
126
|
-
errorType = err
|
|
127
|
-
|
|
128
|
-
}).reject(_.isEmpty).get(0, "unknown");
|
|
126
|
+
errorType = _this3._retrieveMessageFromError(err, ["cause.type", "type"], "unknown");
|
|
127
|
+
errorMessage = _this3._retrieveMessageFromError(err, ["cause.message", "message"], "");
|
|
129
128
|
now = new Date();
|
|
130
129
|
return {
|
|
131
130
|
id: id,
|
|
@@ -165,6 +164,13 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
165
164
|
};
|
|
166
165
|
});
|
|
167
166
|
}
|
|
167
|
+
}, {
|
|
168
|
+
key: "_retrieveMessageFromError",
|
|
169
|
+
value: function _retrieveMessageFromError(err, properties, defaultValue) {
|
|
170
|
+
return err && _(properties).map(function (property) {
|
|
171
|
+
return _.get(err, property);
|
|
172
|
+
}).reject(_.isEmpty).get(0, defaultValue);
|
|
173
|
+
}
|
|
168
174
|
}]);
|
|
169
175
|
|
|
170
176
|
return MonitoringCenterObserver;
|