Use whilst instead of forever

this gets rid of the Error object
This commit is contained in:
Girish Ramakrishnan
2019-12-04 11:17:42 -08:00
parent 30eccfb54b
commit 85e17b570b
3 changed files with 24 additions and 26 deletions
+4 -2
View File
@@ -17,6 +17,7 @@ exports = module.exports = {
};
var assert = require('assert'),
BoxError = require('../boxerror.js'),
debug = require('debug')('box:storage/noop'),
EventEmitter = require('events');
@@ -38,7 +39,7 @@ function download(apiConfig, backupFilePath, callback) {
debug('download: %s', backupFilePath);
callback(new Error('Cannot download from noop backend'));
callback(new BoxError(BoxError.NOT_IMPLEMENTED, 'Cannot download from noop backend'));
}
function listDir(apiConfig, dir, batchSize, iteratorCallback, callback) {
@@ -60,7 +61,7 @@ function downloadDir(apiConfig, backupFilePath, destDir) {
process.nextTick(function () {
debug('downloadDir: %s -> %s', backupFilePath, destDir);
events.emit('done', new Error('Cannot download from noop backend'));
events.emit('done', new BoxError(BoxError.NOT_IMPLEMENTED, 'Cannot download from noop backend'));
});
return events;
}
@@ -109,5 +110,6 @@ function removePrivateFields(apiConfig) {
return apiConfig;
}
// eslint-disable-next-line no-unused-vars
function injectPrivateFields(newConfig, currentConfig) {
}