diff --git a/dist/sentry/index.d.ts b/dist/sentry/index.d.ts index b15796e..ea4c0ef 100644 --- a/dist/sentry/index.d.ts +++ b/dist/sentry/index.d.ts @@ -8,6 +8,9 @@ export interface WrapLambdaHandlerOptions { logger?: (error: Error | string) => void; router?: cassava.Router; sentryDsn: string; + filtersOptions?: { + ignoreErrors?: Array; + }; } /** * Create a handler function that wraps the given handler and initializes Sentry. diff --git a/dist/sentry/index.js b/dist/sentry/index.js index 7af122c..99005eb 100644 --- a/dist/sentry/index.js +++ b/dist/sentry/index.js @@ -17,6 +17,7 @@ let logger = console.error.bind(console); * @returns a Lambda handler */ function wrapLambdaHandler(options) { + var _a; if (options.logger) { logger = options.logger; } @@ -24,7 +25,8 @@ function wrapLambdaHandler(options) { logger = console.error.bind(console); } Sentry.init({ - dsn: options.sentryDsn + dsn: options.sentryDsn, + ignoreErrors: (_a = options.filtersOptions) === null || _a === void 0 ? void 0 : _a.ignoreErrors }); if (!options.router && !options.handler) { logger("Cannot wrap lambda handler: must specify one of router or handler."); diff --git a/dist/sentry/index.js.map b/dist/sentry/index.js.map index 70e2000..0ad6e36 100644 --- a/dist/sentry/index.js.map +++ b/dist/sentry/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sentry/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,uCAAwC;AAExC,IAAI,MAAM,GAA4B,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAUlE;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,OAAiC;IAC/D,IAAI,OAAO,CAAC,MAAM,EAAE;QAChB,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;KAC3B;SAAM;QACH,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KACxC;IAED,MAAM,CAAC,IAAI,CAAC;QACR,GAAG,EAAE,OAAO,CAAC,SAAS;KACzB,CAAC,CAAC;IAEH,IAAI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