Skip to content

Commit 7398cff

Browse files
authored
log unhandled promise rejections (#325)
1 parent eb788eb commit 7398cff

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.changeset/eight-dolls-change.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@livekit/agents": patch
3+
---
4+
5+
log unhandled promise rejections

agents/src/ipc/job_proc_lazy_main.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ const startJob = (
150150
const proc = new JobProcess();
151151
let logger = log().child({ pid: proc.pid });
152152

153+
process.on('unhandledRejection', (reason) => {
154+
logger.error(reason);
155+
});
156+
153157
logger.debug('initializing job runner');
154158
agent.prewarm(proc);
155159
logger.debug('job runner initialized');

0 commit comments

Comments
 (0)