File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -249,22 +249,22 @@ manually hook into such an event handler and call ``Raven.captureException`` or
249
249
directly.
250
250
251
251
For example, the `RSVP.js library
252
- <https://github.com/tildeio/rsvp.js/> `_ allows you to bind an event handler to a `global error event
252
+ <https://github.com/tildeio/rsvp.js/> `_ (used by Ember.js) allows you to bind an event handler to a `global error event
253
253
<https://github.com/tildeio/rsvp.js#error-handling> `_:
254
254
255
255
.. code-block :: javascript
256
256
257
257
RSVP .on (' error' , function (reason ) {
258
- Raven .captureMessage (reason); // NOTE: "reason" is a string
258
+ Raven .captureException (reason);
259
259
});
260
260
261
261
`Bluebird
262
262
<http://bluebirdjs.com/> `_ and other promise libraries report unhandled rejections to a global DOM event, ``unhandledrejection ``:
263
263
264
264
.. code-block :: javascript
265
265
266
- window .addEventListener (' unhandledrejection' , function (err ) {
267
- Raven .captureException (err );
266
+ window .addEventListener (' unhandledrejection' , function (evt ) {
267
+ Raven .captureException (evt . reason );
268
268
});
269
269
270
270
Please consult your promise library documentation on how to hook into its global unhandled rejection handler, if it exposes one.
You can’t perform that action at this time.
0 commit comments