MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / RetrieveError

Function RetrieveError

pkg/webhandlers/error.go:84–89  ·  view source on GitHub ↗

RetrieveError retrieves the error from the context.

(r *http.Request)

Source from the content-addressed store, hash-verified

82
83// RetrieveError retrieves the error from the context.
84func RetrieveError(r *http.Request) error {
85 if err, ok := r.Context().Value(errorKey).(error); ok {
86 return err
87 }
88 return nil
89}
90
91// Error writes the error to the response writer.
92func Error(w http.ResponseWriter, r *http.Request, err error) {

Callers 2

ServeHTTPMethod · 0.92
ServeHTTPMethod · 0.85

Calls 2

ContextMethod · 0.65
ValueMethod · 0.45

Tested by

no test coverage detected