diff --git a/src/ctrl-q.js b/src/ctrl-q.js index 458d015..cb706ce 100644 --- a/src/ctrl-q.js +++ b/src/ctrl-q.js @@ -953,7 +953,6 @@ const program = new Command(); ) .option('--qps-port ', 'Qlik Sense proxy service (QPS) port (usually 4243)', '4243') - .requiredOption('--auth-user-dir ', 'user directory for user to connect with') .requiredOption('--auth-user-id ', 'user ID for user to connect with') diff --git a/src/lib/task/class_alltasks.js b/src/lib/task/class_alltasks.js index 3663c3c..5b40beb 100644 --- a/src/lib/task/class_alltasks.js +++ b/src/lib/task/class_alltasks.js @@ -1599,58 +1599,68 @@ class QlikSenseTasks { let axiosConfig; let tasks = []; + let result; - // Get reload tasks - if (filter === '') { - axiosConfig = setupQRSConnection(this.options, { - method: 'get', - fileCert: this.fileCert, - fileCertKey: this.fileCertKey, - fileCertCA: this.fileCertCA, - path: '/qrs/reloadtask/full', - }); - } else { - axiosConfig = setupQRSConnection(this.options, { - method: 'get', - fileCert: this.fileCert, - fileCertKey: this.fileCertKey, - fileCertCA: this.fileCertCA, - path: '/qrs/reloadtask/full', - queryParameters: [{ name: 'filter', value: filter }], - }); - } - - let result = await axios.request(axiosConfig); - logger.debug(`GET RELOAD TASK: Result=result.status`); + try { + // Get reload tasks + if (filter === '') { + axiosConfig = setupQRSConnection(this.options, { + method: 'get', + fileCert: this.fileCert, + fileCertKey: this.fileCertKey, + fileCertCA: this.fileCertCA, + path: '/qrs/reloadtask/full', + }); + } else { + axiosConfig = setupQRSConnection(this.options, { + method: 'get', + fileCert: this.fileCert, + fileCertKey: this.fileCertKey, + fileCertCA: this.fileCertCA, + path: '/qrs/reloadtask/full', + queryParameters: [{ name: 'filter', value: filter }], + }); + } - tasks = tasks.concat(JSON.parse(result.data)); - logger.verbose(`GET RELOAD TASK: # tasks: ${tasks.length}`); + result = await axios.request(axiosConfig); + logger.debug(`GET RELOAD TASK: Result=result.status`); - // Get external program tasks - if (filter === '') { - axiosConfig = setupQRSConnection(this.options, { - method: 'get', - fileCert: this.fileCert, - fileCertKey: this.fileCertKey, - fileCertCA: this.fileCertCA, - path: '/qrs/externalprogramtask/full', - }); - } else { - axiosConfig = setupQRSConnection(this.options, { - method: 'get', - fileCert: this.fileCert, - fileCertKey: this.fileCertKey, - fileCertCA: this.fileCertCA, - path: '/qrs/externalprogramtask/full', - queryParameters: [{ name: 'filter', value: filter }], - }); + tasks = tasks.concat(JSON.parse(result.data)); + logger.verbose(`GET RELOAD TASK: # tasks: ${tasks.length}`); + } catch (err) { + catchLog('GET TASKS FROM QSEOW 1', err); + reject(err); } + try { + // Get external program tasks + if (filter === '') { + axiosConfig = setupQRSConnection(this.options, { + method: 'get', + fileCert: this.fileCert, + fileCertKey: this.fileCertKey, + fileCertCA: this.fileCertCA, + path: '/qrs/externalprogramtask/full', + }); + } else { + axiosConfig = setupQRSConnection(this.options, { + method: 'get', + fileCert: this.fileCert, + fileCertKey: this.fileCertKey, + fileCertCA: this.fileCertCA, + path: '/qrs/externalprogramtask/full', + queryParameters: [{ name: 'filter', value: filter }], + }); + } - result = await axios.request(axiosConfig); - logger.debug(`GET EXT PROGRAM TASK: Result=result.status`); + result = await axios.request(axiosConfig); + logger.debug(`GET EXT PROGRAM TASK: Result=result.status`); - tasks = tasks.concat(JSON.parse(result.data)); - logger.verbose(`GET EXT PROGRAM TASK: # tasks: ${tasks.length}`); + tasks = tasks.concat(JSON.parse(result.data)); + logger.verbose(`GET EXT PROGRAM TASK: # tasks: ${tasks.length}`); + } catch (err) { + catchLog('GET EXTERNAL PROGRAM TASKS FROM QSEOW 1', err); + reject(err); + } // TODO // Determine whether task name anonymisation should be done