Просмотр исходного кода

Merge pull request #5964 from overleaf/bg-fix-error-handling-in-scripts

[document-updater] fix error handling in scripts

GitOrigin-RevId: d80506e0e42ffce70e9eb3571e02bea274f7a263
Brian Gough 4 лет назад
Родитель
Сommit
780dc55761

+ 2 - 4
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)
   })

+ 2 - 4
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)
     })
 })