MCPcopy Index your code
hub / github.com/CodisLabs/codis / ApiResponseError

Function ApiResponseError

pkg/utils/rpc/api.go:180–190  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

178}
179
180func ApiResponseError(err error) (int, string) {
181 if err == nil {
182 return 800, ""
183 }
184 b, err := apiMarshalJson(NewRemoteError(err))
185 if err != nil {
186 return 800, ""
187 } else {
188 return 800, string(b)
189 }
190}
191
192func ApiResponseJson(v interface{}) (int, string) {
193 b, err := apiMarshalJson(v)

Callers 1

ApiResponseJsonFunction · 0.85

Calls 2

apiMarshalJsonFunction · 0.85
NewRemoteErrorFunction · 0.85

Tested by

no test coverage detected