diff --git a/packages/batcher/runtime/src/index.ts b/packages/batcher/runtime/src/index.ts index 8d8f63d5d..fea9e8d5c 100644 --- a/packages/batcher/runtime/src/index.ts +++ b/packages/batcher/runtime/src/index.ts @@ -189,4 +189,10 @@ async function main(): Promise { await runtime.run(gameInputValidator, batchedTransactionPoster, provider); } -void main(); +main().catch(e => { + // we catch the error here instead of relying on `uncaughtException` monitoring + // because if an exception causes us to reach this line, it means the error was thrown during initalization + // which is typically something we cannot recover from + console.error(e); + process.exit(1); +});