diff --git a/src/docker.js b/src/docker.js index e700c02ec..0015c8bc3 100644 --- a/src/docker.js +++ b/src/docker.js @@ -387,9 +387,12 @@ function deleteContainer(containerId, callback) { container.remove(removeOptions, function (error) { if (error && error.statusCode === 404) return callback(null); - if (error) debug('Error removing container %s : %j', containerId, error); + if (error) { + debug('Error removing container %s : %j', containerId, error); + return callback(new BoxError(BoxError.DOCKER_ERROR, error)); + } - callback(new BoxError(BoxError.DOCKER_ERROR, error)); + callback(null); }); }