Skip to content

Commit be56c12

Browse files
committed
docs: Document collectWindowErrors option
1 parent 50d0705 commit be56c12

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

docs/config.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,17 @@ Those configuration options are documented below:
145145
includePaths: [/https?:\/\/getsentry\.com/, /https?:\/\/cdn\.getsentry\.com/]
146146
}
147147
148+
.. describe:: collectWindowErrors
149+
150+
By default, Raven collects all uncaught errors that have been caught by the `onerror` handler.
151+
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`.
152+
153+
.. code-block:: javascript
154+
155+
{
156+
collectWindowErrors: false
157+
}
158+
148159
.. describe:: sampleRate
149160

150161
A sampling rate to apply to events. A value of 0.0 will send no events,

typescript/raven-tests.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ var options: Raven.RavenOptions = {
2020
/https?:\/\/google\.com/,
2121
'https://www.google.com'
2222
],
23+
collectWindowErrors: false,
2324
autoBreadcrumbs: {
2425
xhr: false,
2526
console: false,
@@ -78,4 +79,4 @@ Raven.showReportDialog({
7879
eventId: 'abcdef123456'
7980
});
8081

81-
Raven.setDSN('https://public@sentry.io/2');
82+
Raven.setDSN('https://public@sentry.io/2');

typescript/raven.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ declare module Raven {
3535
/** An array of regex patterns to indicate which urls are a part of your app. */
3636
includePaths?: (RegExp | string)[];
3737

38+
/** set to false to disable collecting window errors */
39+
collectWindowErrors?: boolean;
40+
3841
/** Additional data to be tagged onto the error. */
3942
tags?: {
4043
[id: string]: string;

0 commit comments

Comments
 (0)