mirror of https://github.com/docker/docs.git
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:
parent
58baa9ea29
commit
3a99c4ca85
|
|
@ -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())
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue