Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/apis/admin/alter-client-quotas-v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export function parseResponse (
}

if (entry.errorCode !== 0) {
errors.push([`/entries/${i}`, entry.errorCode])
errors.push([`/entries/${i}`, [entry.errorCode, entry.errorMessage]])
}

return entry
Expand Down
5 changes: 3 additions & 2 deletions src/apis/admin/alter-configs-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,15 @@ export function parseResponse (
throttleTimeMs: reader.readInt32(),
responses: reader.readArray((r, i) => {
const errorCode = r.readInt16()
const errorMessage = r.readNullableString()

if (errorCode !== 0) {
errors.push([`/responses/${i}`, errorCode])
errors.push([`/responses/${i}`, [errorCode, errorMessage]])
}

return {
errorCode,
errorMessage: r.readNullableString(),
errorMessage,
resourceType: r.readInt8(),
resourceName: r.readString()
}
Expand Down
7 changes: 4 additions & 3 deletions src/apis/admin/alter-partition-reassignments-v0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,16 @@ export function parseResponse (

const throttleTimeMs = reader.readInt32()
const errorCode = reader.readInt16()
const errorMessage = reader.readNullableString()

if (errorCode !== 0) {
errors.push(['', errorCode])
errors.push(['', [errorCode, errorMessage ?? '']])
}

const response: AlterPartitionReassignmentsResponse = {
throttleTimeMs,
errorCode,
errorMessage: reader.readNullableString(),
errorMessage,
responses: reader.readArray((r, i) => {
return {
name: r.readString(),
Expand All @@ -96,7 +97,7 @@ export function parseResponse (
}

if (partition.errorCode !== 0) {
errors.push([`responses/${i}/partitions/${j}`, partition.errorCode])
errors.push([`responses/${i}/partitions/${j}`, [partition.errorCode, partition.errorMessage]])
}

return partition
Expand Down
4 changes: 2 additions & 2 deletions src/apis/admin/alter-partition-v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function parseResponse (
const errorCode = reader.readInt16()

if (errorCode !== 0) {
errors.push(['/', errorCode])
errors.push(['/', [errorCode, null]])
}

const response: AlterPartitionResponse = {
Expand All @@ -125,7 +125,7 @@ export function parseResponse (
}

if (partition.errorCode !== 0) {
errors.push([`/topics/${i}/partitions/${j}`, partition.errorCode])
errors.push([`/topics/${i}/partitions/${j}`, [partition.errorCode, null]])
}

return partition
Expand Down
2 changes: 1 addition & 1 deletion src/apis/admin/alter-replica-log-dirs-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function parseResponse (
}

if (partition.errorCode !== 0) {
errors.push([`/results/${i}/partitions/${j}`, partition.errorCode])
errors.push([`/results/${i}/partitions/${j}`, [partition.errorCode, null]])
}

return partition
Expand Down
2 changes: 1 addition & 1 deletion src/apis/admin/alter-user-scram-credentials-v0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function parseResponse (
}

if (result.errorCode !== 0) {
errors.push([`/results/${i}`, result.errorCode])
errors.push([`/results/${i}`, [result.errorCode, result.errorMessage]])
}

return result
Expand Down
5 changes: 3 additions & 2 deletions src/apis/admin/consumer-group-describe-v0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,15 @@ export function parseResponse (
throttleTimeMs: reader.readInt32(),
groups: reader.readArray((r, i) => {
const errorCode = r.readInt16()
const errorMessage = r.readNullableString()

if (errorCode !== 0) {
errors.push([`/groups/${i}`, errorCode])
errors.push([`/groups/${i}`, [errorCode, errorMessage]])
}

return {
errorCode,
errorMessage: r.readNullableString(),
errorMessage,
groupId: r.readString(),
groupState: r.readString(),
groupEpoch: r.readInt32(),
Expand Down
2 changes: 1 addition & 1 deletion src/apis/admin/create-acls-v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function parseResponse (
}

if (result.errorCode !== 0) {
errors.push([`/results/${i}`, result.errorCode])
errors.push([`/results/${i}`, [result.errorCode, result.errorMessage]])
}

return result
Expand Down
2 changes: 1 addition & 1 deletion src/apis/admin/create-delegation-token-v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export function parseResponse (
}

if (response.errorCode !== 0) {
throw new ResponseError(apiKey, apiVersion, { '': response.errorCode }, response)
throw new ResponseError(apiKey, apiVersion, { '/': [response.errorCode, null] }, response)
}

return response
Expand Down
2 changes: 1 addition & 1 deletion src/apis/admin/create-partitions-v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export function parseResponse (
}

if (result.errorCode !== 0) {
errors.push([`/results/${i}`, result.errorCode])
errors.push([`/results/${i}`, [result.errorCode, result.errorMessage]])
}

return result
Expand Down
2 changes: 1 addition & 1 deletion src/apis/admin/create-partitions-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function parseResponse (
}

if (result.errorCode !== 0) {
errors.push([`/results/${i}`, result.errorCode])
errors.push([`/results/${i}`, [result.errorCode, result.errorMessage]])
}

return result
Expand Down
2 changes: 1 addition & 1 deletion src/apis/admin/create-partitions-v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function parseResponse (
}

if (result.errorCode !== 0) {
errors.push([`/results/${i}`, result.errorCode])
errors.push([`/results/${i}`, [result.errorCode, result.errorMessage]])
}

return result
Expand Down
2 changes: 1 addition & 1 deletion src/apis/admin/create-topics-v7.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export function parseResponse (
}

if (topic.errorCode !== 0) {
errors.push([`/topics/${i}`, topic.errorCode])
errors.push([`/topics/${i}`, [topic.errorCode, topic.errorMessage]])
}

return topic
Expand Down
10 changes: 6 additions & 4 deletions src/apis/admin/delete-acls-v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,26 @@ export function parseResponse (
throttleTimeMs: reader.readInt32(),
filterResults: reader.readArray((r, i) => {
const errorCode = r.readInt16()
const errorMessage = r.readNullableString()

if (errorCode !== 0) {
errors.push([`/filter_results/${i}`, errorCode])
errors.push([`/filter_results/${i}`, [errorCode, errorMessage]])
}

return {
errorCode,
errorMessage: r.readNullableString(),
errorMessage,
matchingAcls: r.readArray((r, j) => {
const errorCode = r.readInt16()
const errorMessage = r.readNullableString()

if (errorCode !== 0) {
errors.push([`/filter_results/${i}/matching_acls/${j}`, errorCode])
errors.push([`/filter_results/${i}/matching_acls/${j}`, [errorCode, errorMessage]])
}

return {
errorCode,
errorMessage: r.readNullableString(),
errorMessage,
resourceType: r.readInt8(),
resourceName: r.readString(),
patternType: r.readInt8(),
Expand Down
2 changes: 1 addition & 1 deletion src/apis/admin/delete-groups-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function parseResponse (
}

if (group.errorCode !== 0) {
errors.push([`/results/${i}`, group.errorCode])
errors.push([`/results/${i}`, [group.errorCode, null]])
}

return group
Expand Down
2 changes: 1 addition & 1 deletion src/apis/admin/delete-records-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function parseResponse (
}

if (partition.errorCode !== 0) {
errors.push([`topics[${i}].partitions[${j}]`, partition.errorCode])
errors.push([`topics[${i}].partitions[${j}]`, [partition.errorCode, null]])
}

return partition
Expand Down
2 changes: 1 addition & 1 deletion src/apis/admin/delete-topics-v6.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function parseResponse (
}

if (topicResponse.errorCode !== 0) {
errors.push([`/responses/${i}`, topicResponse.errorCode])
errors.push([`/responses/${i}`, [topicResponse.errorCode, topicResponse.errorMessage]])
}

return topicResponse
Expand Down
2 changes: 1 addition & 1 deletion src/apis/admin/describe-acls-v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function parseResponse (
}

if (response.errorCode) {
throw new ResponseError(apiKey, apiVersion, { '': response.errorCode }, response)
throw new ResponseError(apiKey, apiVersion, { '/': [response.errorCode, response.errorMessage] }, response)
}

return response
Expand Down
2 changes: 1 addition & 1 deletion src/apis/admin/describe-client-quotas-v0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function parseResponse (
}

if (response.errorCode !== 0) {
throw new ResponseError(apiKey, apiVersion, { '': response.errorCode }, response)
throw new ResponseError(apiKey, apiVersion, { '/': [response.errorCode, response.errorMessage] }, response)
}

return response
Expand Down
2 changes: 1 addition & 1 deletion src/apis/admin/describe-cluster-v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function parseResponse (
}

if (response.errorCode !== 0) {
throw new ResponseError(apiKey, apiVersion, { '': response.errorCode }, response)
throw new ResponseError(apiKey, apiVersion, { '/': [response.errorCode, response.errorMessage] }, response)
}

return response
Expand Down
5 changes: 3 additions & 2 deletions src/apis/admin/describe-configs-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,15 @@ export function parseResponse (
results: reader.readArray(
(r, i) => {
const errorCode = r.readInt16()
const errorMessage = r.readNullableString(false)

if (errorCode !== 0) {
errors.push([`/results/${i}`, errorCode])
errors.push([`/results/${i}`, [errorCode, errorMessage]])
}

return {
errorCode,
errorMessage: r.readNullableString(false),
errorMessage,
resourceType: r.readInt8(),
resourceName: r.readString(false),
configs: r.readArray(
Expand Down
5 changes: 3 additions & 2 deletions src/apis/admin/describe-configs-v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,15 @@ export function parseResponse (
results: reader.readArray(
(r, i) => {
const errorCode = r.readInt16()
const errorMessage = r.readNullableString(false)

if (errorCode !== 0) {
errors.push([`/results/${i}`, errorCode])
errors.push([`/results/${i}`, [errorCode, errorMessage]])
}

return {
errorCode,
errorMessage: r.readNullableString(false),
errorMessage,
resourceType: r.readInt8(),
resourceName: r.readString(false),
configs: r.readArray(
Expand Down
5 changes: 3 additions & 2 deletions src/apis/admin/describe-configs-v4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,15 @@ export function parseResponse (
throttleTimeMs: reader.readInt32(),
results: reader.readArray((r, i) => {
const errorCode = r.readInt16()
const errorMessage = r.readNullableString()

if (errorCode !== 0) {
errors.push([`/results/${i}`, errorCode])
errors.push([`/results/${i}`, [errorCode, errorMessage]])
}

return {
errorCode,
errorMessage: r.readNullableString(),
errorMessage,
resourceType: r.readInt8(),
resourceName: r.readString(),
configs: r.readArray(r => {
Expand Down
2 changes: 1 addition & 1 deletion src/apis/admin/describe-delegation-token-v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export function parseResponse (
}

if (response.errorCode !== 0) {
throw new ResponseError(apiKey, apiVersion, { '': response.errorCode }, response)
throw new ResponseError(apiKey, apiVersion, { '/': [response.errorCode, null] }, response)
}

return response
Expand Down
2 changes: 1 addition & 1 deletion src/apis/admin/describe-groups-v5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function parseResponse (
}

if (group.errorCode !== 0) {
errors.push([`/groups/${i}`, group.errorCode])
errors.push([`/groups/${i}`, [group.errorCode, null]])
}

return group
Expand Down
4 changes: 2 additions & 2 deletions src/apis/admin/describe-log-dirs-v4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function parseResponse (
const errorCode = reader.readInt16()

if (errorCode !== 0) {
errors.push(['', errorCode])
errors.push(['/', [errorCode, null]])
}

const response: DescribeLogDirsResponse = {
Expand All @@ -89,7 +89,7 @@ export function parseResponse (
const errorCode = r.readInt16()

if (errorCode !== 0) {
errors.push([`/results/${i}`, errorCode])
errors.push([`/results/${i}`, [errorCode, null]])
}

return {
Expand Down
2 changes: 1 addition & 1 deletion src/apis/admin/describe-producers-v0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function parseResponse (
}

if (partition.errorCode !== 0) {
errors.push([`/partitions/${i}`, partition.errorCode])
errors.push([`/partitions/${i}`, [partition.errorCode, partition.errorMessage]])
}

return partition
Expand Down
7 changes: 4 additions & 3 deletions src/apis/admin/describe-quorum-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,14 @@ export function parseResponse (
const errors: ResponseErrorWithLocation[] = []

const errorCode = reader.readInt16()
const errorMessage = reader.readNullableString()

if (errorCode !== 0) {
errors.push(['', errorCode])
errors.push(['', [errorCode, errorMessage]])
}
const response: DescribeQuorumResponse = {
errorCode,
errorMessage: reader.readNullableString(),
errorMessage,
topics: reader.readArray((r, i) => {
return {
topicName: r.readString(),
Expand Down Expand Up @@ -154,7 +155,7 @@ export function parseResponse (
}

if (partition.errorCode !== 0) {
errors.push([`/topics/${i}/partitions/${j}`, partition.errorCode])
errors.push([`/topics/${i}/partitions/${j}`, [partition.errorCode, partition.errorMessage]])
}

return partition
Expand Down
4 changes: 2 additions & 2 deletions src/apis/admin/describe-topic-partitions-v0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export function parseResponse (
const errorCode = r.readInt16()

if (errorCode !== 0) {
errors.push([`/topics/${i}`, errorCode])
errors.push([`/topics/${i}`, [errorCode, null]])
}

return {
Expand All @@ -123,7 +123,7 @@ export function parseResponse (
const errorCode = r.readInt16()

if (errorCode !== 0) {
errors.push([`/topics/${i}/partitions/${j}`, errorCode])
errors.push([`/topics/${i}/partitions/${j}`, [errorCode, null]])
}

return {
Expand Down
2 changes: 1 addition & 1 deletion src/apis/admin/describe-transactions-v0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function parseResponse (
}

if (state.errorCode !== 0) {
errors.push([`/transaction_states/${i}`, state.errorCode])
errors.push([`/transaction_states/${i}`, [state.errorCode, null]])
}

return state
Expand Down
Loading