You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At this point you'll likely need to integrate it into your application via
37
-
middleware or another integration mechanism. Take a look at our documentation
38
-
on :doc:`integrations/index` and :doc:`usage`.
38
+
You can optionally pass an object of configuration options as the 2nd argument to `Client`. For
39
+
more information, see :doc:`config`.
39
40
40
41
Reporting Errors
41
42
----------------
42
43
43
-
You'll want to start by injecting a global error handler, which will catch any
44
-
exceptions which would bubble up to the Node runtime:
44
+
To get started passing errors to Raven, it is recommended to initialize Raven's global error handler using
45
+
``patchGlobal``. This will cause any uncaught exception which would bubble up to the Node runtime to be
46
+
captured and processed by Raven.
45
47
46
48
.. code-block:: javascript
47
49
48
50
client.patchGlobal();
49
51
50
-
Beyond that, the simplest way is to explicitly capture and report potentially
51
-
problematic code with a ``try...catch`` block and ``Raven.captureException``:
52
+
Additionally, you can manually capture and report potentially problematic code with ``try...catch`` and
53
+
``captureException``:
52
54
53
55
.. code-block:: javascript
54
56
@@ -58,6 +60,8 @@ problematic code with a ``try...catch`` block and ``Raven.captureException``:
58
60
client.captureException(e)
59
61
}
60
62
63
+
The ``captureException`` method optionally takes an object of configuration options as the 2nd argument. For more information, and to learn about other methods provided by the Raven API, see :docs:`usage`.
0 commit comments