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

Function ErrorStrResp

server/common/common.go:95–105  ·  view source on GitHub ↗
(c *gin.Context, str string, code int, l ...bool)

Source from the content-addressed store, hash-verified

93}
94
95func ErrorStrResp(c *gin.Context, str string, code int, l ...bool) {
96 if len(l) != 0 && l[0] {
97 log.Error(str)
98 }
99 c.JSON(200, Resp[interface{}]{
100 Code: code,
101 Message: hidePrivacy(str),
102 Data: nil,
103 })
104 c.Abort()
105}
106
107func SuccessResp(c *gin.Context, data ...interface{}) {
108 SuccessWithMsgResp(c, "success", data...)

Callers 15

GetHandleMethod · 0.92
SendHandleMethod · 0.92
debugFunction · 0.92
S3Function · 0.92
MCPFunction · 0.92
AuthFunction · 0.92
AuthnFunction · 0.92
AuthNotGuestFunction · 0.92
AuthAdminFunction · 0.92
FsGetDirectUploadInfoFunction · 0.92
BuildIndexFunction · 0.92
UpdateIndexFunction · 0.92

Calls 2

hidePrivacyFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected