Added error output when error is unknown

Signed-off-by: French Ben <frenchben@docker.com>
This commit is contained in:
French Ben 2016-05-26 14:08:51 -07:00
Родитель d93d8c40b5
Коммит a6ecf84fe4
1 изменённых файлов: 9 добавлений и 6 удалений

Просмотреть файл

@ -52,12 +52,15 @@ var ContainerHome = React.createClass({
let body; let body;
if (this.props.container.Error) { if (this.props.container.Error) {
let error = this.props.container.Error.message; let error = this.props.container.Error.message;
console.log('Err: %o - %o', typeof error, error); if (!error) {
if (error.indexOf('ETIMEDOUT') !== -1) { error = this.props.container.Error;
error = 'Timeout error - Try and restart your VM by running: \n"docker-machine restart default" in a terminal'; } else {
} if (error.indexOf('ETIMEDOUT') !== -1) {
if (error.indexOf('ECONNREFUSED') !== -1) { error = 'Timeout error - Try and restart your VM by running: \n"docker-machine restart default" in a terminal';
error = 'Is your VM up and running? Check that "docker ps" works in a terminal.'; }
if (error.indexOf('ECONNREFUSED') !== -1) {
error = 'Is your VM up and running? Check that "docker ps" works in a terminal.';
}
} }
body = ( body = (
<div className="details-progress error"> <div className="details-progress error">