To use a deferred func to overwrite the returned error requires using the 'named' error. So reuse err, instead of pipelineError. Also, the old pipelineError will never be nil, since its executed before the error can be set. Signed-off-by: Anusha Ragunathan <anusha@docker.com> Upstream-commit: af2e2562494a11ee8e6ede58a29cc250935e74c4 Component: engine