From 681b60c27d8aab796fa5cb9efe638dadde780ed6 Mon Sep 17 00:00:00 2001 From: Eneko Lakasta Date: Fri, 25 May 2018 17:25:38 +0200 Subject: [PATCH] return error if batch job has no proper DB configuration --- batch/query_runner.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/batch/query_runner.js b/batch/query_runner.js index a067dd86..7dd3001b 100644 --- a/batch/query_runner.js +++ b/batch/query_runner.js @@ -18,13 +18,12 @@ QueryRunner.prototype.run = function (job_id, sql, user, timeout, dbparams, call return this._run(dbparams, job_id, sql, timeout, callback); } - this.userDatabaseMetadataService.getUserMetadata(user, (err, userDBParams) => { - if (err) { - return callback(err); - } + const dbConfigurationError = new Error('Batch Job DB misconfiguration'); + dbConfigurationError.type = 'batch-job'; + dbConfigurationError.subtype = 'job-db-conf-error'; + dbConfigurationError.http_status = 400; - this._run(userDBParams, job_id, sql, timeout, callback); - }); + return callback(dbConfigurationError); }; QueryRunner.prototype._run = function (dbparams, job_id, sql, timeout, callback) {