func ctxSetErr(r *http.Request, err error) *http.Request {
	return r.WithContext(context.WithValue(r.Context(), errCtx, err))
}
ctxSetErr sets err in the request context, and returns the new request.
package rest
import (
	"context"
	"net/http"
)
type ctxVar int
var errCtx ctxVar = 0
var domainCtx ctxVar = 1
func CtxErr(r *http.Request) error {
	val := r.Context().Value(errCtx)
	if val == nil {
		return nil
	}
	return val.(error)
}