From b123b2aceef01fd617a2c7f4957847a6b5c1e1ed Mon Sep 17 00:00:00 2001 From: Peter Savchenko Date: Mon, 30 Sep 2024 17:00:38 +0300 Subject: [PATCH 1/2] feat(before-send): ability to dismiss error --- README.md | 4 ++++ example/index.html | 6 +++--- package.json | 2 +- src/catcher.ts | 24 ++++++++++++++++++++---- src/errors.ts | 12 ++++++++++++ 5 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 src/errors.ts diff --git a/README.md b/README.md index b76484be..83af47d6 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,10 @@ window.hawk = new HawkCatcher({ }) ``` +## Dismiss error + +You can use the `beforeSend()` hook to prevent sending a particular event. Return `false` for that. + ## Integrate to Vue application Vue apps have their own error handler, so if you want to catcher errors thrown inside Vue components, you should set up a Vue integration. diff --git a/example/index.html b/example/index.html index a4ad7b8e..34400210 100644 --- a/example/index.html +++ b/example/index.html @@ -152,7 +152,7 @@

Test console catcher



- +

Test Vue integration: $root

@@ -227,8 +227,8 @@

Test Vue integration: <test-component>