mirror of https://github.com/docker/compose.git
Unwrap error message.
Signed-off-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
2e85b3c265
commit
466374bdd0
|
@ -169,6 +169,14 @@ func imageAlreadyPresent(serviceImage string, localImages map[string]string) boo
|
||||||
return ok && tagged.Tag() != "latest"
|
return ok && tagged.Tag() != "latest"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getUnwrappedErrorMessage(err error) string {
|
||||||
|
derr := errors.Unwrap(err)
|
||||||
|
if derr != nil {
|
||||||
|
return getUnwrappedErrorMessage(derr)
|
||||||
|
}
|
||||||
|
return err.Error()
|
||||||
|
}
|
||||||
|
|
||||||
func (s *composeService) pullServiceImage(ctx context.Context, service types.ServiceConfig,
|
func (s *composeService) pullServiceImage(ctx context.Context, service types.ServiceConfig,
|
||||||
configFile driver.Auth, w progress.Writer, quietPull bool, defaultPlatform string) (string, error) {
|
configFile driver.Auth, w progress.Writer, quietPull bool, defaultPlatform string) (string, error) {
|
||||||
w.Event(progress.Event{
|
w.Event(progress.Event{
|
||||||
|
@ -203,7 +211,7 @@ func (s *composeService) pullServiceImage(ctx context.Context, service types.Ser
|
||||||
ID: service.Name,
|
ID: service.Name,
|
||||||
Status: progress.Warning,
|
Status: progress.Warning,
|
||||||
Text: "Warning",
|
Text: "Warning",
|
||||||
StatusText: err.Error(),
|
StatusText: getUnwrappedErrorMessage(err),
|
||||||
})
|
})
|
||||||
return "", WrapCategorisedComposeError(err, PullFailure)
|
return "", WrapCategorisedComposeError(err, PullFailure)
|
||||||
}
|
}
|
||||||
|
@ -213,7 +221,7 @@ func (s *composeService) pullServiceImage(ctx context.Context, service types.Ser
|
||||||
ID: service.Name,
|
ID: service.Name,
|
||||||
Status: progress.Error,
|
Status: progress.Error,
|
||||||
Text: "Error",
|
Text: "Error",
|
||||||
StatusText: err.Error(),
|
StatusText: getUnwrappedErrorMessage(err),
|
||||||
})
|
})
|
||||||
return "", WrapCategorisedComposeError(err, PullFailure)
|
return "", WrapCategorisedComposeError(err, PullFailure)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue