Skip to content

Commit 375c141

Browse files
committed
docs: Add platform tags to Electron integration
1 parent 6f76108 commit 375c141

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

docs/integrations/electron.rst

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ First, let's configure ``main process``, which uses Node.js SDK:
1919

2020
.. code-block:: javascript
2121
22-
var Raven = require('raven'):
22+
var Raven = require('raven');
2323
2424
Raven.config('___PUBLIC_DSN___', {
2525
captureUnhandledRejections: true
@@ -29,12 +29,42 @@ And now ``renderer process``, which uses Browser SDK:
2929

3030
.. code-block:: javascript
3131
32-
var Raven = require('raven-js') ;
32+
var Raven = require('raven-js');
3333
Raven.config('___PUBLIC_DSN___').install();
3434
3535
window.addEventListener('unhandledrejection', function (event) {
3636
Raven.captureException(event.reason);
3737
});
3838
39-
This configuration will also handle promises errors, which be handled in various way, however, by default Electron uses standard JS API.
39+
This configuration will also take care of unhandled Promise rejections, which can be handled in various way, however, by default Electron uses standard JS API.
4040
To learn more about handling promises, refer to :doc:`Promises <../usage#promises>` documentation.
41+
42+
Sending environment information
43+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44+
45+
It's often a good idea to send platform information alongside with caught error.
46+
Some things that we can easily add, but are not limited to are:
47+
48+
- Environment type (browser/renderer)
49+
- Electron version
50+
- Chrome version
51+
- Operation System type
52+
- Operation System release
53+
54+
You can configure both processes in the same way. To do his, require standard Node.js module `os` and add `tags` attribute to your `config` call:
55+
56+
.. code-block:: javascript
57+
58+
var os = require('os');
59+
var Raven = require('raven');
60+
61+
Raven.config('___PUBLIC_DSN___', {
62+
captureUnhandledRejections: true,
63+
tags: {
64+
process: process.type,
65+
electron: process.versions.electron,
66+
chrome: process.versions.chrome,
67+
platform: os.platform(),
68+
platform_release: os.release()
69+
}
70+
}).install();

0 commit comments

Comments
 (0)