Merge pull request #359 from koddsson/master-fix-scratch-run-message

Replace hard-coded error message with props.
This commit is contained in:
Jeffrey Morgan 2015-04-04 16:25:01 -04:00
commit 8e66b7b949
2 changed files with 11 additions and 2 deletions

View File

@ -74,7 +74,9 @@ var ContainerHome = React.createClass({
if (this.props.error) {
body = (
<div className="details-progress">
<h3>There was a problem connecting to the Docker Engine in the VirtualBox VM.<br/>This could be caused because this Mac is currently connected to a VPN, blocking access to the VM. If the issue persists, please <a onClick={this.handleErrorClick}>file a ticket on our GitHub repo.</a></h3>
<h3>An error occurred:</h3>
<h2>{this.props.error}</h2>
<h3>If you feel that this error is invalid, please <a onClick={this.handleErrorClick}>file a ticket on our GitHub repo.</a></h3>
<Radial progress={100} error={true} thick={true} transparent={true}/>
</div>
);

View File

@ -56,6 +56,12 @@ var ContainerStore = assign(Object.create(EventEmitter.prototype), {
var data = JSON.parse(str);
console.log(data);
if (data.error) {
_error = data.error;
callback(data.error);
return;
}
if (data.status && (data.status === 'Pulling dependent layers' || data.status.indexOf('already being pulled by another client') !== -1)) {
blockedCallback();
return;
@ -82,7 +88,8 @@ var ContainerStore = assign(Object.create(EventEmitter.prototype), {
progressCallback(totalProgress);
});
stream.on('end', function () {
callback();
callback(_error);
_error = null;
});
});
});