MCPcopy Create free account
hub / github.com/PuerNya/git-proxy / responseWithError

Function responseWithError

main.go:650–656  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

648}
649
650func responseWithError(err error) http.Handler {
651 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
652 log.ErrorContext(r.Context(), err)
653 render.Status(r, http.StatusInternalServerError)
654 render.JSON(w, r, newError(err.Error()))
655 })
656}
657
658func responseWithRedirect(URL *url.URL) http.Handler {
659 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

Callers 2

finalHandlerFunction · 0.85
sendRequestWithURLFunction · 0.85

Calls 2

newErrorFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected