Ignore 404 error. Remove trailing white spaces from error, including new lines.

Signed-off-by: Dong Chen <dongluo.chen@docker.com>
This commit is contained in:
Dong Chen 2016-02-01 20:03:44 -08:00
parent 58baa9ea29
commit 3a99c4ca85
1 changed files with 8 additions and 1 deletions

View File

@ -280,7 +280,7 @@ func (e *Engine) ValidationComplete() {
func (e *Engine) setErrMsg(errMsg string) {
e.Lock()
defer e.Unlock()
e.lastError = errMsg
e.lastError = strings.TrimSpace(errMsg)
e.updatedAt = time.Now()
}
@ -342,6 +342,13 @@ func (e *Engine) CheckConnectionErr(err error) {
return
}
// Docker engine may return 404 when it doesn't recognize a command.
// It's not an error from the engine itself. Version validation should be done separately.
// This error message is not recorded here to avoid user confusion.
if strings.HasPrefix(err.Error(), "404 ") {
return
}
// update engine error message
e.setErrMsg(err.Error())