Skip to content

Commit

Permalink
docs: fixed README usage
Browse files Browse the repository at this point in the history
  • Loading branch information
niftylettuce committed Jan 22, 2020
1 parent cd2a67b commit bb4553b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -808,12 +808,17 @@ If you're curious why it won't work in IE11, please see this [great documentatio
// <https://github.com/cabinjs/cabin#stacktrace>
//
var cabin = new Cabin({ key: 'YOUR-CABIN-API-KEY' });
// Use cabin globally in your app (instead of `console`)
window.cabin = cabin;
// Bind event listeners
uncaught.start();
uncaught.addListener(function(err, event) {
if (!err) {
if (typeof ErrorEvent === 'function' && event instanceof ErrorEvent)
return logger.error(event.message, { event: event });
logger.error({ event: event });
return cabin.error(event.message, { event: event });
cabin.error({ event: event });
return;
}
// this will transform the error's `stack` property
Expand Down

0 comments on commit bb4553b

Please sign in to comment.