MCPcopy Create free account
hub / github.com/PuerkitoBio/fetchbot / HandleError

Method HandleError

handler.go:107–111  ·  view source on GitHub ↗

HandleError registers a Handler for a specific error value. Multiple calls with the same error value override previous calls. As a special case, a nil error value registers a Handler for any error that doesn't have a specific Handler.

(err error, h Handler)

Source from the content-addressed store, hash-verified

105// error value registers a Handler for any error that doesn't have a specific
106// Handler.
107func (mux *Mux) HandleError(err error, h Handler) {
108 mux.mu.Lock()
109 defer mux.mu.Unlock()
110 mux.errm[err] = h
111}
112
113// HandleErrors registers a Handler for any error that doesn't have a specific
114// Handler.

Callers 2

HandleErrorsMethod · 0.95
TestMuxFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestMuxFunction · 0.76