Skip to content

Commit

Permalink
js: change to use errors.Is
Browse files Browse the repository at this point in the history
Signed-off-by: Waldemar Quevedo <wally@nats.io>
  • Loading branch information
wallyqs committed Aug 14, 2022
1 parent aca125a commit 5df3e6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jsm.go
Expand Up @@ -304,8 +304,8 @@ func (js *js) AccountInfo(opts ...JSOpt) (*AccountInfo, error) {
}
if info.Error != nil {
var err error
// Check based on error code instead of description match.
if info.Error.ErrorCode == ErrJetStreamNotEnabled.ErrorCode() {
// Internally checks based on error code instead of description match.
if errors.Is(info.Error, ErrJetStreamNotEnabled) {
err = ErrJetStreamNotEnabled
} else {
err = &jsAPIError{
Expand Down

0 comments on commit 5df3e6f

Please sign in to comment.