notification-processor 4.19.1 → 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 errorDescription, 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
- errorDescription = err && _(["cause.message", "message", "cause.type", "type"]).map(function (property) {
127
- return _.get(err, property);
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,
@@ -150,7 +149,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
150
149
  app: _this3.app,
151
150
  error: _.omit(err, ["detail.request", "cause.detail.request"]),
152
151
  request: _.omit(theRequest, _.castArray(_this3.propertiesToOmit).concat("auth")),
153
- type: errorDescription,
154
152
  tags: _.get(err, "tags", []),
155
153
  message: partialMessage || notification.message
156
154
  }),
@@ -159,13 +157,20 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
159
157
  integration: _this3.app + "|" + (job || _this3.job),
160
158
  // Generic app fields
161
159
  event_timestamp: eventTimestamp || now.getTime(),
162
- output_message: errorDescription,
160
+ error_type: errorType,
163
161
  user_settings_version: null, //TODO
164
162
  env_version: null, //TODO
165
163
  code_version: null //TODO
166
164
  };
167
165
  });
168
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
+ }
169
174
  }]);
170
175
 
171
176
  return MonitoringCenterObserver;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notification-processor",
3
- "version": "4.19.1",
3
+ "version": "4.19.3",
4
4
  "description": "notification-processor",
5
5
  "main": "index.js",
6
6
  "scripts": {