Skip to content

Commit a703188

Browse files
committed
[errors][xs]: printing instructions for linux users on xdg-open error - fixes #332
1 parent f29a0bf commit a703188

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/utils/error.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const Raven = require('raven')
33

44
// Ours:
55
const error = require('./output/error')
6+
const info = require('./output/info')
67
const {version} = require('../../package.json')
78
const {installedWithNPM} = require('./tools')
89

@@ -45,6 +46,10 @@ async function handleError(err, {debug = false} = {}) {
4546
err.forEach(err => error(err.message))
4647
} else {
4748
error(err)
49+
// Check if error is due to `xdg-open` module on Linux and print instructions:
50+
if (err.message && err.message.includes('xdg-open')) {
51+
info('Run following command and try again, please:\ncp /usr/bin/xdg-open /usr/local/bin/xdg-open')
52+
}
4853
}
4954
}
5055
}

0 commit comments

Comments
 (0)