File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ // Packages:
2+ const Raven = require ( 'raven' )
3+
4+ // Ours:
15const error = require ( './output/error' )
6+ const { version} = require ( '../../package.json' )
7+ const { installedWithNPM} = require ( './tools' )
8+
29
310function handleError ( err , { debug = false } = { } ) {
11+ if ( process . env . datahub !== 'dev' ) { // Send report to Sentry if not dev env
12+ // Setup Sentry:
13+ Raven . config ( 'https://e29902aa81ed414d867f51bd0d1ab91a:[email protected] /305079' , { 14+ release : version ,
15+ extra : {
16+ firstArg : process . argv . slice ( 2 , 3 ) ,
17+ rest : process . argv . slice ( 3 , process . argv . length ) ,
18+ nodejsOrBin : installedWithNPM ? process . version : 'bin'
19+ }
20+ } )
21+
22+ // Capture errors:
23+ Raven . captureException ( err , ( sendErr , eventId ) => {
24+ // Once report is sent exit with code 1:
25+ process . exit ( 1 )
26+ } )
27+ }
28+
429 // Coerce Strings to Error instances
530 if ( typeof err === 'string' ) {
631 err = new Error ( err )
Original file line number Diff line number Diff line change 8585 "mkdirp" : " ^0.5.1" ,
8686 "ora" : " ^1.3.0" ,
8787 "pkg" : " 4.2.5" ,
88+ "raven" : " ^2.4.2" ,
8889 "universal-analytics" : " ^0.4.16" ,
8990 "unzip" : " ^0.1.11" ,
9091 "update-notifier" : " ^2.3.0" ,
You can’t perform that action at this time.
0 commit comments