Use BoxError instead of Error in all places

This moves everything other than the addon code and some 'done' logic
This commit is contained in:
Girish Ramakrishnan
2019-12-04 10:29:06 -08:00
parent 3623831390
commit 30eccfb54b
17 changed files with 45 additions and 36 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ exports = module.exports = {
};
let assert = require('assert'),
BoxError = require('./boxerror.js'),
debug = require('debug')('box:apptaskmanager'),
fs = require('fs'),
locker = require('./locker.js'),
@@ -42,7 +43,7 @@ function scheduleTask(appId, taskId, callback) {
if (!gInitialized) initializeSync();
if (appId in gActiveTasks) {
return callback(new Error(`Task for %s is already active: ${appId}`));
return callback(new BoxError(BoxError.CONFLICT, `Task for %s is already active: ${appId}`));
}
if (Object.keys(gActiveTasks).length >= TASK_CONCURRENCY) {