Use NOT_IMPLEMENTED error code

This commit is contained in:
Girish Ramakrishnan
2019-12-04 10:21:42 -08:00
parent 0b6fbfd910
commit d0a3d00492
2 changed files with 11 additions and 7 deletions

View File

@@ -28,6 +28,7 @@ exports = module.exports = {
};
var assert = require('assert'),
BoxError = require('../boxerror.js'),
EventEmitter = require('events');
function removePrivateFields(apiConfig) {
@@ -35,6 +36,7 @@ function removePrivateFields(apiConfig) {
return apiConfig;
}
// eslint-disable-next-line no-unused-vars
function injectPrivateFields(newConfig, currentConfig) {
// in-place injection of tokens and api keys which came in with domains.SECRET_PLACEHOLDER
}
@@ -48,7 +50,7 @@ function upload(apiConfig, backupFilePath, sourceStream, callback) {
// Result: none
// sourceStream errors are handled upstream
callback(new Error('not implemented'));
callback(new BoxError(BoxError.NOT_IMPLEMENTED, 'upload is not implemented'));
}
function download(apiConfig, backupFilePath, callback) {
@@ -57,7 +59,7 @@ function download(apiConfig, backupFilePath, callback) {
assert.strictEqual(typeof callback, 'function');
// Result: download stream
callback(new Error('not implemented'));
callback(new BoxError(BoxError.NOT_IMPLEMENTED, 'download is not implemented'));
}
function downloadDir(apiConfig, backupFilePath, destDir) {
@@ -87,7 +89,7 @@ function listDir(apiConfig, dir, batchSize, iteratorCallback, callback) {
assert.strictEqual(typeof iteratorCallback, 'function');
assert.strictEqual(typeof callback, 'function');
callback(new Error('not implemented'));
callback(new BoxError(BoxError.NOT_IMPLEMENTED, 'listDir is not implemented'));
}
function remove(apiConfig, filename, callback) {
@@ -97,7 +99,7 @@ function remove(apiConfig, filename, callback) {
// Result: none
callback(new Error('not implemented'));
callback(new BoxError(BoxError.NOT_IMPLEMENTED, 'remove is not implemented'));
}
function removeDir(apiConfig, pathPrefix) {
@@ -106,7 +108,7 @@ function removeDir(apiConfig, pathPrefix) {
// Result: none
var events = new EventEmitter();
process.nextTick(function () { events.emit('done', new Error('not implemented')); });
process.nextTick(function () { events.emit('done', new BoxError(BoxError.NOT_IMPLEMENTED, 'removeDir is not implemented')); });
return events;
}
@@ -116,6 +118,6 @@ function testConfig(apiConfig, callback) {
// Result: none - first callback argument error if config does not pass the test
callback(new Error('not implemented'));
callback(new BoxError(BoxError.NOT_IMPLEMENTED, 'testConfig is not implemented'));
}