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

Method checkCtxErr

js.go:3500–3505  ·  view source on GitHub ↗

checkCtxErr is used to determine whether ErrTimeout should be returned in case of context timeout

(err error)

Source from the content-addressed store, hash-verified

3498
3499// checkCtxErr is used to determine whether ErrTimeout should be returned in case of context timeout
3500func (o *pullOpts) checkCtxErr(err error) error {
3501 if o.ctx == nil && errors.Is(err, context.DeadlineExceeded) {
3502 return ErrTimeout
3503 }
3504 return err
3505}
3506
3507func (js *js) getConsumerInfo(stream, consumer string) (*ConsumerInfo, error) {
3508 ctx, cancel := context.WithTimeout(context.Background(), js.opts.wait)

Callers 2

FetchMethod · 0.95
FetchBatchMethod · 0.95

Calls 1

IsMethod · 0.45

Tested by

no test coverage detected