@naturalcycles/backend-lib 4.18.3 → 4.18.5

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.
@@ -92,14 +92,11 @@ class SentrySharedService {
92
92
  // It will log additional "breadcrumb object" before the error
93
93
  // It's a Breadcrumb, not a console.log, because console.log are NOT automatically attached as Breadcrumbs in cron-job environments (outside of Express)
94
94
  this.sentry().addBreadcrumb({
95
- message: (0, nodejs_lib_1.inspectAny)(err, INSPECT_OPT),
95
+ message: [err, data]
96
+ .filter(js_lib_1._isNotEmpty)
97
+ .map(a => (0, nodejs_lib_1.inspectAny)(a, INSPECT_OPT))
98
+ .join('\n'),
96
99
  });
97
- if (data) {
98
- // Log the attached ErrorData (if any)
99
- this.sentry().addBreadcrumb({
100
- message: (0, nodejs_lib_1.inspectAny)(data, INSPECT_OPT),
101
- });
102
- }
103
100
  return this.sentry().captureException(err);
104
101
  }
105
102
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/backend-lib",
3
- "version": "4.18.3",
3
+ "version": "4.18.5",
4
4
  "scripts": {
5
5
  "prepare": "husky install",
6
6
  "serve": "APP_ENV=dev nodemon",
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  _anyToError,
3
+ _isNotEmpty,
3
4
  _Memo,
4
5
  AppError,
5
6
  CommonLogger,
@@ -113,16 +114,12 @@ export class SentrySharedService {
113
114
  // It will log additional "breadcrumb object" before the error
114
115
  // It's a Breadcrumb, not a console.log, because console.log are NOT automatically attached as Breadcrumbs in cron-job environments (outside of Express)
115
116
  this.sentry().addBreadcrumb({
116
- message: inspectAny(err, INSPECT_OPT),
117
+ message: [err, data]
118
+ .filter(_isNotEmpty)
119
+ .map(a => inspectAny(a, INSPECT_OPT))
120
+ .join('\n'),
117
121
  })
118
122
 
119
- if (data) {
120
- // Log the attached ErrorData (if any)
121
- this.sentry().addBreadcrumb({
122
- message: inspectAny(data, INSPECT_OPT),
123
- })
124
- }
125
-
126
123
  return this.sentry().captureException(err)
127
124
  }
128
125