From 35bee4dcc2f8b1b787ae26ed4e5d06778fa6b651 Mon Sep 17 00:00:00 2001 From: Dmitry <98899785+mdqst@users.noreply.github.com> Date: Tue, 15 Apr 2025 21:36:01 +0300 Subject: [PATCH 1/2] fix: logger initialization, async/await usage, and error handling --- apps/node/src/app.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/node/src/app.ts b/apps/node/src/app.ts index fdcf456a..1a9292a8 100644 --- a/apps/node/src/app.ts +++ b/apps/node/src/app.ts @@ -11,14 +11,14 @@ import { Logger } from "@uma/logger"; dotenv.config(); -const logger = Logger; +const logger = new Logger(); async function run() { const { APP } = process.env; assert(APP, 'Specify the application to start with "APP=appname pnpm start"'); switch (APP) { case "template": - void (await Template.Main(process.env)); + await Template.Main(process.env); return "Example template app running"; case "indexer": void (await Indexer.Main(Indexer.envToConfig(process.env), logger)); @@ -36,4 +36,6 @@ async function run() { run() .then((x) => x && logger.info({ at: "app", message: x })) - .catch(console.log); + .catch((error) => { + logger.error(error); + }); From f7ed38e0be8c9cd3c0150541eb81dc985f7b526e Mon Sep 17 00:00:00 2001 From: Dmitry <98899785+mdqst@users.noreply.github.com> Date: Thu, 17 Apr 2025 12:27:27 +0300 Subject: [PATCH 2/2] Update app.ts --- apps/node/src/app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/node/src/app.ts b/apps/node/src/app.ts index 1a9292a8..f103f00d 100644 --- a/apps/node/src/app.ts +++ b/apps/node/src/app.ts @@ -11,7 +11,7 @@ import { Logger } from "@uma/logger"; dotenv.config(); -const logger = new Logger(); +const logger = Logger; async function run() { const { APP } = process.env;