MCPcopy Create free account
hub / github.com/chain/Core / jsonHandler

Function jsonHandler

core/api.go:396–402  ·  view source on GitHub ↗
(f interface{})

Source from the content-addressed store, hash-verified

394}
395
396func jsonHandler(f interface{}) http.Handler {
397 h, err := httpjson.Handler(f, errorFormatter.Write)
398 if err != nil {
399 panic(err)
400 }
401 return h
402}
403
404func alwaysError(err error) http.Handler {
405 return jsonHandler(func() error { return err })

Callers 3

buildHandlerMethod · 0.85
alwaysErrorFunction · 0.85
MockHSMFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected