MCPcopy
hub / github.com/nats-io/nats.go / Is

Method Is

jetstream/errors.go:498–509  ·  view source on GitHub ↗

Is matches against an APIError.

(err error)

Source from the content-addressed store, hash-verified

496
497// Is matches against an APIError.
498func (e *APIError) Is(err error) bool {
499 if e == nil {
500 return false
501 }
502 // Extract internal APIError to match against.
503 var aerr *APIError
504 ok := errors.As(err, &aerr)
505 if !ok {
506 return ok
507 }
508 return e.ErrorCode == aerr.ErrorCode
509}
510
511func (err *jsError) APIError() *APIError {
512 return err.apiErr

Callers 15

ConsumeMethod · 0.45
KeyValueMethod · 0.45
CreateKeyValueMethod · 0.45
UpdateKeyValueMethod · 0.45
DeleteKeyValueMethod · 0.45
KeyValueStoreNamesMethod · 0.45
KeyValueStoresMethod · 0.45
getMethod · 0.45
GetMethod · 0.45
GetRevisionMethod · 0.45
CreateMethod · 0.45
CreateOrUpdateStreamMethod · 0.45

Calls

no outgoing calls

Tested by 15

TestMessageMetadataFunction · 0.36
TestConsumerInfoFunction · 0.36
TestConsumerOverflowFunction · 0.36
TestConsumerPinnedFunction · 0.36
TestConsumerUnpinFunction · 0.36
TestAckVariantsFunction · 0.36
TestPushConsumerConsumeFunction · 0.36
TestJetStreamErrorsFunction · 0.36
TestPublishMsgFunction · 0.36
TestPublishWithTTLFunction · 0.36
TestPublishAsyncWithTTLFunction · 0.36
TestPublishFunction · 0.36