Skip to content

Commit a7aaa2c

Browse files
authored
fix(outbox): log unloaded handler modules as a failure, not a completed run (#8755)
1 parent 1a4a156 commit a7aaa2c

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎apps/sim/lib/core/outbox/processor.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,19 @@ export async function runOutboxProcessor(): Promise<OutboxProcessorResult> {
6363
logger.error('Completed outbox pruning failed', { error: toError(error).message })
6464
}
6565

66-
const output = { result, reapedBackgroundWork, recoveredDocuments, prunedEvents }
67-
logger.info('Outbox processing completed', {
66+
const summary = {
6867
...result,
6968
reapedBackgroundWork,
7069
recoveredDocuments,
7170
prunedEvents,
7271
durationMs: Date.now() - startedAt,
73-
})
72+
}
7473
/** Fail the run so a broken handler module stays as visible as the crash its static import caused. */
7574
if (result.unloadedEventTypes.length > 0) {
76-
throw new Error(
77-
`Outbox handler modules failed to load; left pending: ${result.unloadedEventTypes.join(', ')}`
78-
)
75+
const message = `Outbox handler modules failed to load; left pending: ${result.unloadedEventTypes.join(', ')}`
76+
logger.warn(message, summary)
77+
throw new Error(message)
7978
}
80-
return output
79+
logger.info('Outbox processing completed', summary)
80+
return { result, reapedBackgroundWork, recoveredDocuments, prunedEvents }
8181
}

0 commit comments

Comments
 (0)