notification-processor 4.19.0 → 4.19.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.
@@ -118,11 +118,14 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
118
118
  job = _ref3.job,
119
119
  partialMessage = _ref3.partialMessage;
120
120
 
121
- var now, theRequest;
121
+ var errorDescription, 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
129
  now = new Date();
127
130
  return {
128
131
  id: id,
@@ -147,7 +150,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
147
150
  app: _this3.app,
148
151
  error: _.omit(err, ["detail.request", "cause.detail.request"]),
149
152
  request: _.omit(theRequest, _.castArray(_this3.propertiesToOmit).concat("auth")),
150
- type: err && _.get(err, "type", "unknown"),
153
+ type: errorDescription,
151
154
  tags: _.get(err, "tags", []),
152
155
  message: partialMessage || notification.message
153
156
  }),
@@ -156,7 +159,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
156
159
  integration: _this3.app + "|" + (job || _this3.job),
157
160
  // Generic app fields
158
161
  event_timestamp: eventTimestamp || now.getTime(),
159
- output_message: _.get(err, "type"),
162
+ output_message: errorDescription,
160
163
  user_settings_version: null, //TODO
161
164
  env_version: null, //TODO
162
165
  code_version: null //TODO
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notification-processor",
3
- "version": "4.19.0",
3
+ "version": "4.19.1",
4
4
  "description": "notification-processor",
5
5
  "main": "index.js",
6
6
  "scripts": {