diff --git a/src/dns/interface.js b/src/dns/interface.js index 94841eb9e..9de4cd15c 100644 --- a/src/dns/interface.js +++ b/src/dns/interface.js @@ -17,6 +17,7 @@ exports = module.exports = { }; var assert = require('assert'), + BoxError = require('../boxerror.js'), util = require('util'); function removePrivateFields(domainObject) { @@ -24,6 +25,7 @@ function removePrivateFields(domainObject) { return domainObject; } +// 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 } @@ -80,5 +82,5 @@ function verifyDnsConfig(domainObject, callback) { // Result: dnsConfig object - callback(new Error('not implemented')); + callback(new BoxError(BoxError.NOT_IMPLEMENTED, 'verifyDnsConfig is not implemented')); } diff --git a/src/storage/interface.js b/src/storage/interface.js index 11aed198d..a262d6954 100644 --- a/src/storage/interface.js +++ b/src/storage/interface.js @@ -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')); }