From ad0e61ddb18014b1b869391a0c9b41787d5b2ee3 Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Tue, 31 Oct 2023 08:50:29 +0000 Subject: [PATCH] fix: unhandledRejection types are looser than assumed (#18286) * fix: unhandledRejection types are looser than assumed * simpler than that * delegate logging the things to the log framework - which should at least be safe --- plugin-server/src/main/pluginsServer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin-server/src/main/pluginsServer.ts b/plugin-server/src/main/pluginsServer.ts index 45e6a1c8b07b3..2257a3c2c97fd 100644 --- a/plugin-server/src/main/pluginsServer.ts +++ b/plugin-server/src/main/pluginsServer.ts @@ -183,8 +183,8 @@ export async function startPluginsServer( 27, // REBALANCE_IN_PROGRESS ]) - process.on('unhandledRejection', (error: Error) => { - status.error('🤮', `Unhandled Promise Rejection: ${error.stack}`) + process.on('unhandledRejection', (error: Error | any, promise: Promise) => { + status.error('🤮', `Unhandled Promise Rejection`, { error, promise }) if (error instanceof KafkaJSProtocolError) { kafkaProtocolErrors.inc({