Add checks for empty response in JetStream API calls #1642
Labels
accepted
The defect or proposal as been accepted
enhancement
Enhancement to existing functionality
help wanted
proposal
Enhancement idea or proposal
Proposed change
Add checks for
nil
in all JetStream API requests injetstream
package.For example, in upsertConsumer(), a check could be added returning a new error kind:
Package should be scanned for places where API requests are sent, e.g. CRUD operations on streams, consumers,
AccountInfo
etc.Use case
While unlikely, it may happen that the server responds to JetStream API requests with unexpected data, neither
apiResponse
(for errors) nor the actual expected type.While not common, this can happen e.g. due to server bug and in such cases the client should not panic but simply return an error indicating what happened.
#1641 was a motivation for this proposal.
Contribution
No response
The text was updated successfully, but these errors were encountered: