MCPcopy Create free account
hub / github.com/tailscale/tailscale / ErrorHandler

Function ErrorHandler

tsweb/tsweb.go:482–484  ·  view source on GitHub ↗

ErrorHandler converts a [ReturnHandler] into a standard [http.Handler]. Errors are handled as specified by the [ReturnHandler.ServeHTTPReturn] method. When wrapped in a [LogHandler], panics are added to the [AccessLogRecord]; otherwise, panics continue up the stack.

(h ReturnHandler, opts ErrorOptions)

Source from the content-addressed store, hash-verified

480// When wrapped in a [LogHandler], panics are added to the [AccessLogRecord];
481// otherwise, panics continue up the stack.
482func ErrorHandler(h ReturnHandler, opts ErrorOptions) http.Handler {
483 return errorHandler{h, opts.withDefaults()}
484}
485
486// errCallback is added to logHandler's request context so that errorHandler can
487// pass errors back up the stack to logHandler.

Callers 2

TestErrorHandler_PanicFunction · 0.85
StdHandlerFunction · 0.85

Calls 1

withDefaultsMethod · 0.45

Tested by 1

TestErrorHandler_PanicFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…