Fix error handling
This commit is contained in:
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user