MCPcopy Create free account
hub / github.com/evcc-io/evcc / jsonError

Function jsonError

server/http_site_handler.go:89–92  ·  view source on GitHub ↗
(w http.ResponseWriter, status int, err error)

Source from the content-addressed store, hash-verified

87}
88
89func jsonError(w http.ResponseWriter, status int, err error) {
90 w.WriteHeader(status)
91 jsonWrite(w, util.ErrorAsJson(err))
92}
93
94func handler[T any](conv func(string) (T, error), set func(T) error, get func() T) http.HandlerFunc {
95 return func(w http.ResponseWriter, r *http.Request) {

Callers 15

energyHistoryHandlerFunction · 0.70
configYamlHandlerFunction · 0.70
authHandlerFunction · 0.70
templatesHandlerFunction · 0.70
productsHandlerFunction · 0.70
sessionHandlerFunction · 0.70
deleteSessionHandlerFunction · 0.70
updateSessionHandlerFunction · 0.70

Calls 2

ErrorAsJsonFunction · 0.92
jsonWriteFunction · 0.70

Tested by

no test coverage detected