{ "html": "
Raven is distributed via npm
:
$ npm install raven --save\n
Next you need to initialize the Raven client and configure it to use your Sentry DSN:
\nvar Raven = require('raven');\nRaven.config('___DSN___').install();\n
At this point, Raven is set up to capture and report any uncaught exceptions.
\nYou can optionally pass an object of configuration options as the 2nd argument to Raven.config. For\nmore information, see Configuration.
\nRaven’s install
method sets up a global handler to automatically capture any uncaught exceptions. You can also report errors manually with try...catch
and\na call to captureException
:
try {\n doSomething(a[0]);\n} catch (e) {\n Raven.captureException(e);\n}\n
You can also use wrap
and context
to have Raven wrap a function and automatically capture any exceptions it throws:
Raven.context(function () {\n doSomething(a[0]);\n});\n
For more information on reporting errors, see Usage.
\n