diff --git a/docs/config.rst b/docs/config.rst index 65fed4b1e3a7..01adc87f5146 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -145,6 +145,17 @@ Those configuration options are documented below: includePaths: [/https?:\/\/getsentry\.com/, /https?:\/\/cdn\.getsentry\.com/] } +.. describe:: collectWindowErrors + + By default, Raven collects all uncaught errors that have been caught by the `onerror` handler. + You can disable this behaviour by setting this flag to `false`. This may be useful when you only want to manually handle errors by using the `captureMessage` and `captureException`. + + .. code-block:: javascript + + { + collectWindowErrors: false + } + .. describe:: sampleRate A sampling rate to apply to events. A value of 0.0 will send no events, diff --git a/typescript/raven-tests.ts b/typescript/raven-tests.ts index b8d40bdce70b..dcf73891958a 100644 --- a/typescript/raven-tests.ts +++ b/typescript/raven-tests.ts @@ -20,6 +20,7 @@ var options: Raven.RavenOptions = { /https?:\/\/google\.com/, 'https://www.google.com' ], + collectWindowErrors: false, autoBreadcrumbs: { xhr: false, console: false, @@ -78,4 +79,4 @@ Raven.showReportDialog({ eventId: 'abcdef123456' }); -Raven.setDSN('https://public@sentry.io/2'); \ No newline at end of file +Raven.setDSN('https://public@sentry.io/2'); diff --git a/typescript/raven.d.ts b/typescript/raven.d.ts index ccc6ae6e28a9..1ecd61bb3c73 100644 --- a/typescript/raven.d.ts +++ b/typescript/raven.d.ts @@ -35,6 +35,9 @@ declare module Raven { /** An array of regex patterns to indicate which urls are a part of your app. */ includePaths?: (RegExp | string)[]; + /** set to false to disable collecting window errors */ + collectWindowErrors?: boolean; + /** Additional data to be tagged onto the error. */ tags?: { [id: string]: string;