return BackupError and not SubdomainError

This commit is contained in:
Girish Ramakrishnan
2015-11-06 18:08:25 -08:00
parent b6f1ad75b8
commit de471b0012
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ var assert = require('assert'),
AWS = require('aws-sdk'),
config = require('./config.js'),
debug = require('debug')('box:aws'),
SubdomainError = require('./subdomains.js').SubdomainError,
BackupError = require('./backups.js').BackupError,
superagent = require('superagent');
function getBackupCredentials(callback) {
@@ -39,7 +39,7 @@ function getBackupCredentials(callback) {
callback(null, credentials);
});
} else {
if (!config.aws().accessKeyId || !config.aws().secretAccessKey) return callback(new SubdomainError(SubdomainError.MISSING_CREDENTIALS));
if (!config.aws().accessKeyId || !config.aws().secretAccessKey) return callback(new BackupError(BackupError.MISSING_CREDENTIALS));
var credentials = {
accessKeyId: config.aws().accessKeyId,
+1
View File
@@ -39,6 +39,7 @@ function BackupsError(reason, errorOrMessage) {
util.inherits(BackupsError, Error);
BackupsError.EXTERNAL_ERROR = 'external error';
BackupsError.INTERNAL_ERROR = 'internal error';
BackupsError.MISSING_CREDENTIALS = 'missing credentials';
function getAllPaged(page, perPage, callback) {
assert.strictEqual(typeof page, 'number');