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

Method Is

micro/service.go:835–843  ·  view source on GitHub ↗

Is reports whether the target error is equal to this error.

(target error)

Source from the content-addressed store, hash-verified

833
834// Is reports whether the target error is equal to this error.
835func (e *NATSError) Is(target error) bool {
836 if e == nil {
837 return false
838 }
839 if t, ok := target.(*NATSError); ok {
840 return e.Subject == t.Subject && e.Description == t.Description
841 }
842 return e.err != nil && errors.Is(e.err, target)
843}
844
845func (g *group) AddEndpoint(name string, handler Handler, opts ...EndpointOpt) error {
846 var options endpointOpts

Callers 9

StopMethod · 0.45
stopMethod · 0.45
TestNATSErrorIsFunction · 0.45
TestNATSErrorWrappingFunction · 0.45
TestAddServiceFunction · 0.45
TestRequestRespondFunction · 0.45
TestControlSubjectFunction · 0.45
TestCustomQueueGroupFunction · 0.45

Calls

no outgoing calls

Tested by 7

TestNATSErrorIsFunction · 0.36
TestNATSErrorWrappingFunction · 0.36
TestAddServiceFunction · 0.36
TestRequestRespondFunction · 0.36
TestControlSubjectFunction · 0.36
TestCustomQueueGroupFunction · 0.36