chore: return an error from the subscribe method for a bad stream #498
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Make the internal subscribe method get the first message and check it to ensure the stream can be read. Without this, certain topic errors won't be caught until the user attempts to iterate over the topic stream.
Break out of the subscription when it receives a permission or authentication error. These cannot be recovered from, so there is no point in reconnecting. This covers the case of a token that expires while being used to read a topic.
Enable the auth client topic tests covering cases that should return an error on subscribe.