Move BackupsError to BoxError
This commit is contained in:
+1
-4
@@ -91,7 +91,6 @@ exports = module.exports = {
|
||||
var addons = require('./addons.js'),
|
||||
assert = require('assert'),
|
||||
backups = require('./backups.js'),
|
||||
BackupsError = backups.BackupsError,
|
||||
BoxError = require('./boxerror.js'),
|
||||
constants = require('./constants.js'),
|
||||
cron = require('./cron.js'),
|
||||
@@ -352,9 +351,7 @@ function setBackupConfig(backupConfig, callback) {
|
||||
backups.injectPrivateFields(backupConfig, curentConfig);
|
||||
|
||||
backups.testConfig(backupConfig, function (error) {
|
||||
if (error && error.reason === BackupsError.BAD_FIELD) return callback(new BoxError(BoxError.BAD_FIELD, error.message));
|
||||
if (error && error.reason === BackupsError.EXTERNAL_ERROR) return callback(new BoxError(BoxError.EXTERNAL_ERROR, error.message));
|
||||
if (error) return callback(new BoxError(BoxError.DATABASE_ERROR, error));
|
||||
if (error) return callback(error);
|
||||
|
||||
backups.cleanupCacheFilesSync();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user