Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the error code be included in the error message. #1461

Open
nieyuyao opened this issue May 27, 2022 · 0 comments
Open

Make the error code be included in the error message. #1461

nieyuyao opened this issue May 27, 2022 · 0 comments

Comments

@nieyuyao
Copy link

When an errorCode is received that is not in the ERROR_CODE , we will not know the errorCode through the error stack.

this.word32bs('partition').word16bs('errorCode').word64bs('offset').tap(function (vars) {
if (vars.errorCode) {
error = new Error(ERROR_CODE[vars.errorCode]);
} else {
topics[vars.topic][vars.partition] = vars.offset;
}

For example, if received an errorCode 82, new Error(undefined) will be thrown. Error stack is as follows,

 Error
    at Object.<anonymous> (/home/appops/approot/server/node_modules/kafka-node/lib/protocol/protocol.js:928:17)
    at Object.self.tap (/home/appops/approot/server/node_modules/binary/index.js:248:12)
    at Object.decodePartitions (/home/appops/approot/server/node_modules/kafka-node/lib/protocol/protocol.js:926:73)
    at Object.self.loop (/home/appops/approot/server/node_modules/binary/index.js:267:16)
    at Object.<anonymous> (/home/appops/approot/server/node_modules/kafka-node/lib/protocol/protocol.js:165:8)
    at Object.self.loop (/home/appops/approot/server/node_modules/binary/index.js:267:16)
    at decodeProduceV1Response (/home/appops/approot/server/node_modules/kafka-node/lib/protocol/protocol.js:920:6)
    at KafkaClient.Client.invokeResponseCallback (/home/appops/approot/server/node_modules/kafka-node/lib/baseClient.js:589:18)
    at KafkaClient.Client.handleReceivedData (/home/appops/approot/server/node_modules/kafka-node/lib/baseClient.js:569:10)
    at KafkaClient.handleReceivedData (/home/appops/approot/server/node_modules/kafka-node/lib/kafkaClient.js:1378:48)

Can make the specific error code be included in the error message?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant