From ac0f532476d1caa225e02c939304000be3c736c9 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Wed, 22 Nov 2017 11:16:46 -0800 Subject: [PATCH] docs: Add unhandledRejection example for node --- docs/usage.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/usage.rst b/docs/usage.rst index f3cc3b165125..5c94f96ca2bc 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -333,6 +333,12 @@ For example, the `RSVP.js library Raven.captureException(evt.reason); }; +Node's native promises are reported through a ``unhandledRejection`` event: + +.. code-block:: javascript + + process.on('unhandledRejection', reason => Raven.captureException(reason)); + Please consult your promise library documentation on how to hook into its global unhandled rejection handler, if it exposes one. Custom Grouping Behavior