Skip to content

Commit 1ce4ce6

Browse files
committed
Include topic in error message
1 parent fad3e16 commit 1ce4ce6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/errors.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ class KafkaJSOffsetOutOfRange extends KafkaJSProtocolError {
4040

4141
class KafkaJSUnknownTopic extends KafkaJSProtocolError {
4242
constructor(e, { topic }) {
43-
super(e, { retriable: false })
43+
super(e)
4444
this.topic = topic
4545
this.name = 'KafkaJSUnknownTopic'
46+
this.message = `${this.message} [${this.topic}]`
4647
}
4748
}
4849

@@ -51,6 +52,7 @@ class KafkaJSTopicAuthorizationFailed extends KafkaJSProtocolError {
5152
super(e, { retriable: false })
5253
this.topic = topic
5354
this.name = 'KafkaJSTopicAuthorizationFailed'
55+
this.message = `${this.message} [${this.topic})]`
5456
}
5557
}
5658
class KafkaJSMemberIdRequired extends KafkaJSProtocolError {

src/protocol/error.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const errorCodes = [
2424
{
2525
type: 'UNKNOWN_TOPIC_OR_PARTITION',
2626
code: 3,
27-
retriable: true,
27+
retriable: false,
2828
message: 'This server does not host this topic-partition',
2929
},
3030
{

0 commit comments

Comments
 (0)