Do not re-translate to DockerError

This commit is contained in:
Girish Ramakrishnan
2019-10-23 09:24:51 -07:00
parent b6f2c94464
commit d0e6b6bfe4
2 changed files with 12 additions and 9 deletions

View File

@@ -306,10 +306,10 @@ function createSubcontainer(app, name, cmd, options, callback) {
debugApp(app, 'Creating container for %s', app.manifest.dockerImage);
docker.createContainer(containerOptions, function (error) {
docker.createContainer(containerOptions, function (error, container) {
if (error) return callback(new BoxError(BoxError.DOCKER_ERROR, error));
callback();
callback(null, container);
});
});
}
@@ -453,9 +453,12 @@ function deleteImage(manifest, callback) {
if (error && error.statusCode === 404) return callback(null); // not found
if (error && error.statusCode === 409) return callback(null); // another container using the image
if (error) debug('Error removing image %s : %j', dockerImage, error);
if (error) {
debug('Error removing image %s : %j', dockerImage, error);
return callback(new BoxError(BoxError.DOCKER_ERROR, error));
}
callback(new BoxError(BoxError.DOCKER_ERROR, error));
callback(null);
});
}