@yrpri/api 9.0.144 → 9.0.145

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yrpri/api",
3
- "version": "9.0.144",
3
+ "version": "9.0.145",
4
4
  "license": "MIT",
5
5
  "author": "Robert Bjarnason & Citizens Foundation",
6
6
  "repository": {
@@ -25,7 +25,7 @@
25
25
  "@google-cloud/vertexai": "^1.10.0",
26
26
  "@google-cloud/vision": "^5.1.0",
27
27
  "@node-saml/passport-saml": "^5.0.1",
28
- "@policysynth/agents": "^1.3.115",
28
+ "@policysynth/agents": "^1.3.116",
29
29
  "async": "^3.2.6",
30
30
  "authorized": "^1.0.0",
31
31
  "aws-sdk": "^2.1692.0",
@@ -6,6 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AirbrakeTransport = void 0;
7
7
  const winston_transport_1 = __importDefault(require("winston-transport"));
8
8
  const node_1 = require("@airbrake/node");
9
+ const IGNORED_ERRORS = (process.env.AIRBRAKE_IGNORED_ERRORS ?? "")
10
+ .split(",")
11
+ .map((e) => e.trim())
12
+ .filter((e) => e.length > 0);
9
13
  class AirbrakeTransport extends winston_transport_1.default {
10
14
  constructor(opts) {
11
15
  super(opts);
@@ -24,7 +28,9 @@ class AirbrakeTransport extends winston_transport_1.default {
24
28
  : info.stack
25
29
  ? Object.assign(new Error(message), { stack: info.stack })
26
30
  : new Error(message);
27
- if (process.env.AIRBRAKE_PROJECT_ID) {
31
+ const shouldNotify = process.env.AIRBRAKE_PROJECT_ID &&
32
+ !IGNORED_ERRORS.some((p) => err.message.includes(p));
33
+ if (shouldNotify) {
28
34
  this.notifier
29
35
  .notify({
30
36
  error: err,
@@ -1,5 +1,9 @@
1
1
  import Transport from "winston-transport";
2
2
  import { Notifier } from "@airbrake/node";
3
+ const IGNORED_ERRORS = (process.env.AIRBRAKE_IGNORED_ERRORS ?? "")
4
+ .split(",")
5
+ .map((e) => e.trim())
6
+ .filter((e) => e.length > 0);
3
7
  export class AirbrakeTransport extends Transport {
4
8
  constructor(opts) {
5
9
  super(opts);
@@ -18,7 +22,9 @@ export class AirbrakeTransport extends Transport {
18
22
  : info.stack
19
23
  ? Object.assign(new Error(message), { stack: info.stack })
20
24
  : new Error(message);
21
- if (process.env.AIRBRAKE_PROJECT_ID) {
25
+ const shouldNotify = process.env.AIRBRAKE_PROJECT_ID &&
26
+ !IGNORED_ERRORS.some((p) => err.message.includes(p));
27
+ if (shouldNotify) {
22
28
  this.notifier
23
29
  .notify({
24
30
  error: err,