Skip to content

Commit 65b9dea

Browse files
committed
Fix promises example re: unhandledrejection in docs
1 parent 53e91d1 commit 65b9dea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/usage.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,22 +249,22 @@ manually hook into such an event handler and call ``Raven.captureException`` or
249249
directly.
250250

251251
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
253253
<https://github.com/tildeio/rsvp.js#error-handling>`_:
254254

255255
.. code-block:: javascript
256256
257257
RSVP.on('error', function(reason) {
258-
Raven.captureMessage(reason); // NOTE: "reason" is a string
258+
Raven.captureException(reason);
259259
});
260260
261261
`Bluebird
262262
<http://bluebirdjs.com/>`_ and other promise libraries report unhandled rejections to a global DOM event, ``unhandledrejection``:
263263

264264
.. code-block:: javascript
265265
266-
window.addEventListener('unhandledrejection', function(err) {
267-
Raven.captureException(err);
266+
window.addEventListener('unhandledrejection', function(evt) {
267+
Raven.captureException(evt.reason);
268268
});
269269
270270
Please consult your promise library documentation on how to hook into its global unhandled rejection handler, if it exposes one.

0 commit comments

Comments
 (0)