浏览代码

added finally condition to end program no matter what

Pablo Barrera Yaksic 7 月之前
父节点
当前提交
b26a07d52b
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 1 1
      package.json
  2. 3 3
      src/index.ts

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "bot-noticias",
-  "version": "0.0.4",
+  "version": "0.0.5",
   "description": "Bot que busca noticias y las replica en mastodon.cl",
   "main": "dist/index.js",
   "scripts": {

+ 3 - 3
src/index.ts

@@ -30,9 +30,9 @@ async function main (): Promise<void> {
 }
 
 main()
-  .then(() => {
-    process.exit(0);
-  })
   .catch((err) => {
     console.error(err)
+  })
+  .finally(() => {
+    process.exit(0);
   });