summaryrefslogtreecommitdiff
path: root/distribution/errors.go
diff options
context:
space:
mode:
authorStephen J Day <stephen.day@docker.com>2016-07-25 14:52:27 -0700
committerStephen J Day <stephen.day@docker.com>2016-07-25 18:31:24 -0700
commitd99c6b837ffd18ffe5bce801feb4936bf0edd2aa (patch)
tree865dad86ff222c18f5c25a6bf12afad9225712a8 /distribution/errors.go
parent8c7468bf3b5f828503b1e284475d2f3c6f1cdd63 (diff)
downloaddocker-d99c6b837ffd18ffe5bce801feb4936bf0edd2aa.tar.gz
swarm/controller: allow cancellation to propagate
Ensure that cancellation of a pull propagates rather than continuing to container creation. This ensures that the `Prepare` method is properly re-entrant. Signed-off-by: Stephen J Day <stephen.day@docker.com>
Diffstat (limited to 'distribution/errors.go')
-rw-r--r--distribution/errors.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/distribution/errors.go b/distribution/errors.go
index a9a17bd261..1e7630e380 100644
--- a/distribution/errors.go
+++ b/distribution/errors.go
@@ -40,7 +40,11 @@ type fallbackError struct {
// Error renders the FallbackError as a string.
func (f fallbackError) Error() string {
- return f.err.Error()
+ return f.Cause().Error()
+}
+
+func (f fallbackError) Cause() error {
+ return f.err
}
// shouldV2Fallback returns true if this error is a reason to fall back to v1.