From d2ee91edeaf3533fa5897160621538871f8776a4 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 30 Nov 2021 15:06:47 +0000 Subject: [PATCH] Merge pull request #5964 from overleaf/bg-fix-error-handling-in-scripts [document-updater] fix error handling in scripts GitOrigin-RevId: d80506e0e42ffce70e9eb3571e02bea274f7a263 --- .../scripts/fix_docs_with_empty_pathnames.js | 6 ++---- .../scripts/fix_docs_with_missing_project.js | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/services/document-updater/scripts/fix_docs_with_empty_pathnames.js b/services/document-updater/scripts/fix_docs_with_empty_pathnames.js index c11af34375..abbfb01ba7 100644 --- a/services/document-updater/scripts/fix_docs_with_empty_pathnames.js +++ b/services/document-updater/scripts/fix_docs_with_empty_pathnames.js @@ -74,8 +74,6 @@ cleanUpDocs({ limit: 1000, dryRun: process.env.DRY_RUN !== 'false' }) console.log('DONE') }) .catch(function (error) { - if (error) { - throw error - } - return process.exit() + console.error(error) + process.exit(1) }) diff --git a/services/document-updater/scripts/fix_docs_with_missing_project.js b/services/document-updater/scripts/fix_docs_with_missing_project.js index c88e71cb01..1830c41057 100644 --- a/services/document-updater/scripts/fix_docs_with_missing_project.js +++ b/services/document-updater/scripts/fix_docs_with_missing_project.js @@ -94,9 +94,7 @@ clientPromise.then(client => { console.log('DONE') }) .catch(function (error) { - if (error) { - throw error - } - return process.exit() + console.error(error) + process.exit(1) }) })