MCPcopy Create free account
hub / github.com/OpenCSGs/csghub-server / ServerError

Function ServerError

api/httpbase/response.go:37–41  ·  view source on GitHub ↗

ServerError responds with a JSON-formatted error message. Example: ServerError(c, errors.New("internal server error"))

(c *gin.Context, err error)

Source from the content-addressed store, hash-verified

35//
36// ServerError(c, errors.New("internal server error"))
37func ServerError(c *gin.Context, err error) {
38 c.PureJSON(http.StatusInternalServerError, R{
39 Msg: err.Error(),
40 })
41}
42
43// UnauthorizedError responds with a JSON-formatted error message.
44//

Callers 15

CreateMethod · 0.92
VerifyMethod · 0.92
OrgMembersMethod · 0.92
UpdateMethod · 0.92
CreateMethod · 0.92
DeleteMethod · 0.92
GetMemberRoleMethod · 0.92
CreateMethod · 0.92
GetMethod · 0.92
IndexMethod · 0.92
DeleteMethod · 0.92

Calls 1

ErrorMethod · 0.80

Tested by

no test coverage detected