Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unify configuration options #341

Merged
merged 1 commit into from
Jul 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -768,17 +768,17 @@ constructor.
var Rollbar = require('rollbar');
var rollbar = new Rollbar({
accessToken: 'POST_SERVER_ITEM_ACCESS_TOKEN',
handleUncaughtExceptions: true,
handleUnhandledRejections: true
captureUncaught: true,
captureUnhandledRejections: true
});

// log a generic message and send to rollbar
rollbar.log('Hello world!');
```
Setting the ```handleUncaughtExceptions``` option to true will register Rollbar as a handler for
Setting the ```captureUncaught``` option to true will register Rollbar as a handler for
any uncaught exceptions in your Node process.

Similarly, setting the ```handleUnhandledRejections``` option to true will register Rollbar as a
Similarly, setting the ```captureUnhandledRejections``` option to true will register Rollbar as a
handler for any unhandled Promise rejections in your Node process.

<!-- RemoveNextIfProject -->
Expand Down Expand Up @@ -1066,8 +1066,8 @@ New:
```js
var rollbar = new Rollbar({
accessToken: "POST_SERVER_ITEM_ACCESS_TOKEN",
handleUncaughtExceptions: true,
handleUnhandledRejections: true
captureUncaught: true,
captureUnhandledRejections: true
});

```
Expand All @@ -1085,7 +1085,7 @@ const Rollbar = require('rollbar');

const rollbar = Rollbar.init({
accessToken: "POST_SERVER_ITEM_ACCESS_TOKEN",
handleUncaughtExceptions: true
captureUncaught: true
});
```

Expand Down
4 changes: 2 additions & 2 deletions src/browser/rollbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ function Rollbar(options, client) {
this.client = client || new Client(this.options, api, logger, 'browser');
addTransformsToNotifier(this.client.notifier);
addPredicatesToQueue(this.client.queue);
if (this.options.captureUncaught) {
if (this.options.captureUncaught || this.options.handleUncaughtExceptions) {
globals.captureUncaughtExceptions(window, this);
globals.wrapGlobals(window, this);
}
if (this.options.captureUnhandledRejections) {
if (this.options.captureUnhandledRejections || this.options.handleUnhandledRejections) {
globals.captureUnhandledRejections(window, this);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/server/rollbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ function Rollbar(options, client) {
addTransformsToNotifier(this.client.notifier);
addPredicatesToQueue(this.client.queue);

if (this.options.handleUncaughtExceptions) {
if (this.options.captureUncaught || this.options.handleUncaughtExceptions) {
this.handleUncaughtExceptions();
}
if (this.options.handleUnhandledRejections) {
if (this.options.captureUnhandledRejections || this.options.handleUnhandledRejections) {
this.handleUnhandledRejections();
}
}
Expand Down