MCPcopy Index your code
hub / github.com/erda-project/erda / ToResp

Method ToResp

pkg/http/httpserver/errorresp/response.go:27–40  ·  view source on GitHub ↗

ToResp 根据 APIError 转为一个 http error response.

()

Source from the content-addressed store, hash-verified

25
26// ToResp 根据 APIError 转为一个 http error response.
27func (e *APIError) ToResp() httpserver.Responser {
28 return &httpserver.HTTPResponse{
29 Error: e,
30 Status: e.httpCode,
31 Content: httpserver.Resp{
32 Success: false,
33 Err: apistructs.ErrorResponse{
34 Code: e.code,
35 Msg: e.msg,
36 Ctx: e.ctx,
37 },
38 },
39 }
40}
41
42// ErrResp 根据 error 转为一个 http error response.
43func ErrResp(e error) (httpserver.Responser, error) {

Callers 15

ErrRespFunction · 0.80
KmsEncryptMethod · 0.80
KmsDecryptMethod · 0.80
KmsGenerateDataKeyMethod · 0.80
KmsRotateKeyVersionMethod · 0.80
KmsCreateKeyMethod · 0.80
KmsDescribeKeyMethod · 0.80
updateNotifyMethod · 0.80
getAllGroupsMethod · 0.80
pipelineCreateV2Method · 0.80
pipelineCallbackMethod · 0.80
healthCheckMethod · 0.80

Calls

no outgoing calls