Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions packages/kafka/lib/AbstractKafkaConsumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { pipeline } from 'node:stream/promises'
import { setTimeout } from 'node:timers/promises'
import {
InternalError,
isError,
resolveGlobalErrorLogObject,
stringValueSerializer,
type TransactionObservabilityManager,
Expand Down Expand Up @@ -239,8 +240,14 @@ export abstract class AbstractKafkaConsumer<

try {
await this.consumer.close()
} catch {
// Ignoring errors at this stage
} catch (err) {
// Reporting error but not throwing further
const resolvedErrorLog = resolveGlobalErrorLogObject(err)
this.logger.warn(resolvedErrorLog, 'Error while closing Kafka consumer')
this.errorReporter.report({
error: isError(err) ? err : new Error('Unknown error while closing Kafka consumer'),
context: resolvedErrorLog,
})
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}
this.consumer = undefined
}
Expand Down
Loading