diff --git a/src/ContainerHome.react.js b/src/ContainerHome.react.js index 45edefcf3d..7bb94fc07f 100644 --- a/src/ContainerHome.react.js +++ b/src/ContainerHome.react.js @@ -74,7 +74,7 @@ var ContainerHome = React.createClass({ if (this.props.error) { body = (
There seems to have been an unexpected error with Kitematic:
-{this.state.error}
{this.state.error.message}
{this.state.error.message || this.state.error}
diff --git a/src/SetupStore.js b/src/SetupStore.js index b2384c2534..556a65ff0b 100644 --- a/src/SetupStore.js +++ b/src/SetupStore.js @@ -115,10 +115,6 @@ var SetupStore = assign(Object.create(EventEmitter.prototype), { error: function () { return _error; }, - setError: function (error) { - _error = error; - this.emit(this.ERROR_EVENT); - }, cancelled: function () { return _cancelled; }, @@ -195,20 +191,7 @@ var SetupStore = assign(Object.create(EventEmitter.prototype), { break; } catch (err) { if (err) { - console.log('Setup encountered an error.'); - console.log(err); - console.log(err.stack); - metrics.track('Setup Failed', { - step: step.name - }); - var virtualboxVersion = virtualBox.installed() ? yield virtualBox.version() : 'Not installed'; - bugsnag.notify('SetupError', 'Setup failed', { - error: err, - step: step.name, - virtualbox: virtualboxVersion - }); - _error = err; - this.emit(this.ERROR_EVENT); + throw err; } else { metrics.track('Setup Cancelled'); _cancelled = true; @@ -223,24 +206,31 @@ var SetupStore = assign(Object.create(EventEmitter.prototype), { }), setup: Promise.coroutine(function * () { while (true) { - var ip = yield this.run(); - if (!ip || !ip.length) { + try { + var ip = yield this.run(); + if (!ip || !ip.length) { + throw { + message: 'Machine IP could not be fetched. Please retry the setup. If this fails please file a ticket on our GitHub repo.', + machine: yield machine.info(), + ip: ip, + }; + } else { + metrics.track('Setup Finished'); + return ip; + } + } catch (err) { metrics.track('Setup Failed', { - step: 'done', - message: 'Machine IP not set' + step: _currentStep }); var virtualboxVersion = virtualBox.installed() ? yield virtualBox.version() : 'Not installed'; - bugsnag.notify('SetupError', 'Machine ip was not set', { - machine: yield machine.info(), - ip: ip, - step: 'done', + bugsnag.notify('SetupError', 'Setup failed', { + error: err, + step: _currentStep, virtualbox: virtualboxVersion }); - SetupStore.setError('Could not reach the Docker Engine inside the VirtualBox VM'); + _error = err; + this.emit(this.ERROR_EVENT); yield this.pause(); - } else { - metrics.track('Setup Finished'); - return ip; } } }) diff --git a/src/SetupUtil.js b/src/SetupUtil.js index 9b7f2d1973..69a69224bc 100644 --- a/src/SetupUtil.js +++ b/src/SetupUtil.js @@ -12,7 +12,8 @@ var SetupUtil = { if (!fs.existsSync('/usr/local') || !fs.existsSync('/usr/local/bin')) { return true; } - if (!fs.existsSync('/usr/local/bin/docker') && !fs.existsSync('/usr/local/bin/docker-machine')) { + + if (!fs.existsSync('/usr/local/bin/docker') || !fs.existsSync('/usr/local/bin/docker-machine')) { return fs.statSync('/usr/local/bin').gid !== 80 || fs.statSync('/usr/local/bin').uid !== process.getuid(); } diff --git a/src/Util.js b/src/Util.js index 4e0bab7a39..7430d0904f 100644 --- a/src/Util.js +++ b/src/Util.js @@ -11,7 +11,7 @@ module.exports = { if (code) { var cmd = Array.isArray(args) ? args.join(' ') : args; reject({ - message: cmd.replace(this.home(), '') + 'returned non zero exit code', + message: cmd.replace(this.home(), '') + ' returned non zero exit code', stderr: stderr, stdout: stdout });