From 04239a39d41ac3b75b3a997b0ef829a386fb111e Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Mon, 2 Mar 2015 10:10:53 -0500 Subject: [PATCH] Better errors --- package.json | 2 +- src/Main.js | 9 +++++++-- src/SetupStore.js | 14 ++++++++++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 0dbba08c7b..d4db181f2a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Kitematic", - "version": "0.5.4", + "version": "0.5.5", "author": "Kitematic", "description": "Simple Docker Container management for Mac OS X.", "homepage": "https://kitematic.com/", diff --git a/src/Main.js b/src/Main.js index 0853f811f5..4628744384 100644 --- a/src/Main.js +++ b/src/Main.js @@ -91,7 +91,9 @@ SetupStore.setup().then(machine => { ContainerStore.init(function (err) { if (err) { console.log(err); - bugsnag.notify(err); + bugsnag.notify('ContainerStoreError', 'Could not init containerstore', { + error: err + }); } router.transitionTo('containers'); }); @@ -100,7 +102,10 @@ SetupStore.setup().then(machine => { step: 'catch', message: err.message }); - bugsnag.notify(err); + bugsnag.notify('SetupError', 'Setup threw an exception', { + step: 'catch', + error: err + }); console.log(err); console.log(err.stack); }); diff --git a/src/SetupStore.js b/src/SetupStore.js index c7aed2a288..ac41ddea72 100644 --- a/src/SetupStore.js +++ b/src/SetupStore.js @@ -197,7 +197,12 @@ var SetupStore = assign(Object.create(EventEmitter.prototype), { metrics.track('Setup Failed', { step: step.name }); - bugsnag.notify(err); + 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); } else { @@ -220,7 +225,12 @@ var SetupStore = assign(Object.create(EventEmitter.prototype), { step: 'done', message: 'Machine URL not set' }); - bugsnag.notify('SetupError', 'Machine url was not set', info); + var virtualboxVersion = virtualBox.installed() ? yield virtualBox.version() : 'Not installed'; + bugsnag.notify('SetupError', 'Machine url was not set', { + machine: info, + step: 'done', + virtualbox: virtualboxVersion + }); SetupStore.setError('Could not reach the Docker Engine inside the VirtualBox VM'); yield this.pause(); } else {