Move AppstoreError to BoxError

This commit is contained in:
Girish Ramakrishnan
2019-10-24 17:28:59 -07:00
parent 4793eb9ef5
commit d6365ff27f
7 changed files with 118 additions and 155 deletions

View File

@@ -10,7 +10,6 @@ exports = module.exports = {
};
var appstore = require('./appstore.js'),
AppstoreError = require('./appstore.js').AppstoreError,
assert = require('assert'),
async = require('async'),
backups = require('./backups.js'),
@@ -67,7 +66,7 @@ function autoRegister(domain, callback) {
debug('Auto-registering cloudron');
appstore.registerWithLicense(license.trim(), domain, function (error) {
if (error && error.reason !== AppstoreError.ALREADY_REGISTERED) {
if (error && error.reason !== BoxError.CONFLICT) { // not already registered
debug('Failed to auto-register cloudron', error);
return callback(new BoxError(BoxError.LICENSE_ERROR, 'Failed to auto-register Cloudron with license. Please contact support@cloudron.io'));
}