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

Method SetErrorHandler

nats.go:1763–1770  ·  view source on GitHub ↗

SetErrorHandler will set the async error handler.

(cb ErrHandler)

Source from the content-addressed store, hash-verified

1761
1762// SetErrorHandler will set the async error handler.
1763func (nc *Conn) SetErrorHandler(cb ErrHandler) {
1764 if nc == nil {
1765 return
1766 }
1767 nc.mu.Lock()
1768 defer nc.mu.Unlock()
1769 nc.Opts.AsyncErrorCB = cb
1770}
1771
1772// ErrorHandler will return the async error handler.
1773func (nc *Conn) ErrorHandler() ErrHandler {

Calls

no outgoing calls