Skip to content

Commit

Permalink
Revert topic when metadata fetching failes due to authorization.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgyimesi committed Jun 3, 2022
1 parent a733eaa commit ec78a0e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cluster/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@ module.exports = class Cluster {
try {
await this.refreshMetadata()
} catch (e) {
if (e.type === 'INVALID_TOPIC_EXCEPTION' || e.type === 'UNKNOWN_TOPIC_OR_PARTITION') {
if (
e.type === 'INVALID_TOPIC_EXCEPTION' ||
e.type === 'UNKNOWN_TOPIC_OR_PARTITION' ||
e.type === 'TOPIC_AUTHORIZATION_FAILED'
) {
this.targetTopics = previousTopics
}

Expand Down

0 comments on commit ec78a0e

Please sign in to comment.