Skip to content

Commit

Permalink
Include topic in error message
Browse files Browse the repository at this point in the history
  • Loading branch information
gfoltz committed Jan 7, 2024
1 parent fad3e16 commit 1ce4ce6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ class KafkaJSOffsetOutOfRange extends KafkaJSProtocolError {

class KafkaJSUnknownTopic extends KafkaJSProtocolError {
constructor(e, { topic }) {
super(e, { retriable: false })
super(e)
this.topic = topic
this.name = 'KafkaJSUnknownTopic'
this.message = `${this.message} [${this.topic}]`
}
}

Expand All @@ -51,6 +52,7 @@ class KafkaJSTopicAuthorizationFailed extends KafkaJSProtocolError {
super(e, { retriable: false })
this.topic = topic
this.name = 'KafkaJSTopicAuthorizationFailed'
this.message = `${this.message} [${this.topic})]`
}
}
class KafkaJSMemberIdRequired extends KafkaJSProtocolError {
Expand Down
2 changes: 1 addition & 1 deletion src/protocol/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const errorCodes = [
{
type: 'UNKNOWN_TOPIC_OR_PARTITION',
code: 3,
retriable: true,
retriable: false,
message: 'This server does not host this topic-partition',
},
{
Expand Down

0 comments on commit 1ce4ce6

Please sign in to comment.