MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / ErrorWithDataResp

Function ErrorWithDataResp

server/common/common.go:79–93  ·  view source on GitHub ↗
(c *gin.Context, err error, code int, data interface{}, l ...bool)

Source from the content-addressed store, hash-verified

77}
78
79func ErrorWithDataResp(c *gin.Context, err error, code int, data interface{}, l ...bool) {
80 if len(l) > 0 && l[0] {
81 if flags.Debug || flags.Dev {
82 log.Errorf("%+v", err)
83 } else {
84 log.Errorf("%v", err)
85 }
86 }
87 c.JSON(200, Resp[interface{}]{
88 Code: code,
89 Message: hidePrivacy(err.Error()),
90 Data: data,
91 })
92 c.Abort()
93}
94
95func ErrorStrResp(c *gin.Context, str string, code int, l ...bool) {
96 if len(l) != 0 && l[0] {

Callers 2

CreateStorageFunction · 0.92
ErrorRespFunction · 0.85

Calls 2

hidePrivacyFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected