Continue if oauth creds not found
This commit is contained in:
+7
-1
@@ -22,6 +22,7 @@ var assert = require('assert'),
|
||||
net = require('net'),
|
||||
config = require('../config.js'),
|
||||
database = require('./database.js'),
|
||||
DatabaseError = require('./databaseerror.js'),
|
||||
ejs = require('ejs'),
|
||||
appFqdn = require('./apps').appFqdn;
|
||||
|
||||
@@ -311,7 +312,12 @@ function removeOAuthCredentials(app, callback) {
|
||||
|
||||
debug('removeOAuthCredentials:', app.id);
|
||||
|
||||
clientdb.del(app.id, callback);
|
||||
clientdb.del(app.id, function (error) {
|
||||
if (error && error.reason === DatabaseError.NOT_FOUND) return callback(null);
|
||||
|
||||
if (error) console.error(error);
|
||||
callback(null);
|
||||
});
|
||||
}
|
||||
|
||||
function startContainer(app, callback) {
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
var DatabaseError = require('./databaseerror'),
|
||||
var DatabaseError = require('./databaseerror.js'),
|
||||
path = require('path'),
|
||||
debug = require('debug')('box:clientdb'),
|
||||
database = require('./database.js'),
|
||||
|
||||
@@ -133,10 +133,9 @@ describe('apptask', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('remove OAuth credentials twice fails', function (done) {
|
||||
it('remove OAuth credentials twice succeeds', function (done) {
|
||||
apptask._removeOAuthCredentials(APP, function (error) {
|
||||
expect(error).to.be.a(DatabaseError);
|
||||
expect(error.reason).to.equal(DatabaseError.NOT_FOUND);
|
||||
expect(!error).to.be.ok();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user