Skip to content

Commit

Permalink
Merge pull request #26 from sirbrillig/add/crash-handling
Browse files Browse the repository at this point in the history
Add sentry handling to crashed/unresponsive events
  • Loading branch information
sirbrillig authored Aug 15, 2017
2 parents 75cffbb + 27d6dca commit d6e6365
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
11 changes: 10 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ const semver = require( 'semver' );
const electronDebug = require( 'electron-debug' );
const { version } = require( './package.json' );
const { checkForUpdates } = require( './lib/updates' );

const Raven = require( 'raven' );
const unhandled = require( 'electron-unhandled' );

// https://sentry.io/ Error reporting
Raven.config( 'https://[email protected]/201433' ).install();

// Catch unhandled Promise rejections
unhandled();

Expand Down Expand Up @@ -38,6 +41,12 @@ bar.on( 'ready', () => {
isDev || bar.window.setResizable( false );
isDev || attachAppMenu();
checkForUpdates( { version, semver, dialog, openUrl: shell.openExternal } );
bar.window.webContents.on( 'crashed', ( event ) => {
Raven.captureException( event );
} );
bar.window.on( 'unresponsive', () => {
Raven.captureException( new Error( 'Window was unresponsive.' ) );
} );
} );

bar.on( 'hide', () => {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"gridicons": "^2.0.1",
"lodash": "^4.17.4",
"menubar": "^5.2.3",
"raven": "^2.1.1",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"react-redux": "^5.0.5",
Expand Down
33 changes: 32 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,10 @@ conf@^1.0.0:
make-dir "^1.0.0"
pkg-up "^2.0.0"

[email protected]:
version "0.3.1"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb"

core-js@^1.0.0:
version "1.2.7"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636"
Expand Down Expand Up @@ -1403,7 +1407,7 @@ json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1:
dependencies:
jsonify "~0.0.0"

json-stringify-safe@~5.0.1:
json-stringify-safe@5.0.1, json-stringify-safe@~5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"

Expand Down Expand Up @@ -1570,6 +1574,10 @@ lru-cache@^4.0.0:
pseudomap "^1.0.2"
yallist "^2.1.2"

[email protected]:
version "1.0.0"
resolved "https://registry.yarnpkg.com/lsmod/-/lsmod-1.0.0.tgz#9a00f76dca36eb23fa05350afe1b585d4299e64b"

macos-alias@~0.2.5:
version "0.2.11"
resolved "https://registry.yarnpkg.com/macos-alias/-/macos-alias-0.2.11.tgz#feeea6c13ba119814a43fc43c470b31e59ef718a"
Expand Down Expand Up @@ -1993,6 +2001,17 @@ random-path@^0.1.0:
base32-encode "^0.1.0"
murmur-32 "^0.1.0"

raven@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/raven/-/raven-2.1.1.tgz#b3a974c6c29315c677c079e168435ead196525cd"
dependencies:
cookie "0.3.1"
json-stringify-safe "5.0.1"
lsmod "1.0.0"
stack-trace "0.0.9"
timed-out "4.0.1"
uuid "3.0.0"

rc@^1.1.2:
version "1.2.1"
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.1.tgz#2e03e8e42ee450b8cb3dce65be1bf8974e1dfd95"
Expand Down Expand Up @@ -2318,6 +2337,10 @@ sshpk@^1.7.0:
jsbn "~0.1.0"
tweetnacl "~0.14.0"

[email protected]:
version "0.0.9"
resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.9.tgz#a8f6eaeca90674c333e7c43953f275b451510695"

stream-buffers@~2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4"
Expand Down Expand Up @@ -2449,6 +2472,10 @@ through@^2.3.6:
version "2.3.8"
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"

[email protected]:
version "4.0.1"
resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f"

[email protected]:
version "0.0.28"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.28.tgz#172735b7f614ea7af39664fa84cf0de4e515d120"
Expand Down Expand Up @@ -2549,6 +2576,10 @@ util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"

[email protected]:
version "3.0.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.0.tgz#6728fc0459c450d796a99c31837569bdf672d728"

uuid@^2.0.1:
version "2.0.3"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a"
Expand Down

0 comments on commit d6e6365

Please sign in to comment.