confluentinc / confluentinc/confluent-kafka-javascript

Capturing the original error code using the Logger Callback

Open
#334 3 comments 1 reaction 0 assignees View on GitHub
enhancement status:waiting-for-interest
Dominant language
TypeScript
Stars
304
Forks
45
Avg merge
11h 47m
Merged PRs (30d)
5

Description

Hello, lets say a logger callback was implemented, something along the lines of the example [here](https://github.com/confluentinc/confluent-kafka-javascript/issues/41#issuecomment-2356338500).

Is there a way to inspect the original error code, such as `ERR__TRANSPORT: -195`

Currently it only seems that the message is exposed to the logger, and not the code. Currently these are logged as errors, when perhaps you might only want to log these as a warn.

Currently the only way to do this seems to be by inspecting the log message string, rather than being able to directly inspect the error code.

It would be helpful if that could be exposed in the [extra](https://github.com/confluentinc/confluent-kafka-javascript/blob/903d64712fdaff8fcde8b45c2b34cdff4d0a2b4d/types/kafkajs.d.ts#L74-L77) object.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.