From 573f3ea5d29b65c7f8c1c1076809ef6340fbbb15 Mon Sep 17 00:00:00 2001 From: Robert Dyer Date: Mon, 1 Jul 2024 15:11:32 -0500 Subject: [PATCH] log unhandled errors by default --- utils.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils.js b/utils.js index dd7def1..8abb12e 100644 --- a/utils.js +++ b/utils.js @@ -3,6 +3,11 @@ require("dotenv").config(); module.exports = { openBudget: async function () { + process.on('unhandledRejection', (reason, p) => { + console.log('Unhandled Rejection at: Promise', p, 'reason:', reason); + console.log(reason.stack); + }); + const url = process.env.ACTUAL_SERVER_URL || ''; const password = process.env.ACTUAL_SERVER_PASSWORD || ''; const file_password = process.env.ACTUAL_FILE_PASSWORD || '';