notification-processor 4.19.0 → 4.19.2

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 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 && _(["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,6 @@ 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"),
151
153
  tags: _.get(err, "tags", []),
152
154
  message: partialMessage || notification.message
153
155
  }),
@@ -156,7 +158,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
156
158
  integration: _this3.app + "|" + (job || _this3.job),
157
159
  // Generic app fields
158
160
  event_timestamp: eventTimestamp || now.getTime(),
159
- output_message: _.get(err, "type"),
161
+ error_type: errorType,
160
162
  user_settings_version: null, //TODO
161
163
  env_version: null, //TODO
162
164
  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.2",
4
4
  "description": "notification-processor",
5
5
  "main": "index.js",
6
6
  "scripts": {