You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Drain is called on a NATS connection object and it is nil, the program panics; while calling Drain on a Subscription does not lead to a panic and returns error.
Expected behavior
I expect that calling Drain() on a NATS connection, an error be returned, instead of panic.
Server and client version
v1.32.0
Host environment
No response
Steps to reproduce
Create a NATS connection with an invalid URL, and the call Drain() on it.
The text was updated successfully, but these errors were encountered:
However, I think it's user responsibility to check error on Connect, as if it is not nil, the Conn can be nil, which is an idiomatic pattern in Go.
Unless you found a scenario, that Connect does not return an error, yet Conn is nil.
Then, we should fix that, but not by checking that nil, but instead by ensuring that error is returned.
Correct, however, there's a similar code for Subscription's Drain, here, checking that the Subscription is not nil. Is there any difference between these two?
Observed behavior
When Drain is called on a NATS connection object and it is nil, the program panics; while calling Drain on a Subscription does not lead to a panic and returns error.
Expected behavior
I expect that calling Drain() on a NATS connection, an error be returned, instead of panic.
Server and client version
v1.32.0
Host environment
No response
Steps to reproduce
Create a NATS connection with an invalid URL, and the call Drain() on it.
The text was updated successfully, but these errors were encountered: