File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { pipeline } from 'node:stream/promises'
33import { setTimeout } from 'node:timers/promises'
44import {
55 InternalError ,
6+ isError ,
67 resolveGlobalErrorLogObject ,
78 stringValueSerializer ,
89 type TransactionObservabilityManager ,
@@ -239,8 +240,14 @@ export abstract class AbstractKafkaConsumer<
239240
240241 try {
241242 await this . consumer . close ( )
242- } catch {
243- // Ignoring errors at this stage
243+ } catch ( err ) {
244+ // Reporting error but not throwing further
245+ const resolvedErrorLog = resolveGlobalErrorLogObject ( err )
246+ this . logger . warn ( resolvedErrorLog , 'Error while closing Kafka consumer' )
247+ this . errorReporter . report ( {
248+ error : isError ( err ) ? err : new Error ( 'Unknown error while closing Kafka consumer' ) ,
249+ context : resolvedErrorLog ,
250+ } )
244251 }
245252 this . consumer = undefined
246253 }
You can’t perform that action at this time.
0 commit comments