MCPcopy
hub / github.com/xpzouying/xiaohongshu-mcp / respondError

Function respondError

handlers_api.go:14–25  ·  view source on GitHub ↗

respondError 返回错误响应

(c *gin.Context, statusCode int, code, message string, details any)

Source from the content-addressed store, hash-verified

12
13// respondError 返回错误响应
14func respondError(c *gin.Context, statusCode int, code, message string, details any) {
15 response := ErrorResponse{
16 Error: message,
17 Code: code,
18 Details: details,
19 }
20
21 logrus.Errorf("%s %s %s %d", c.Request.Method, c.Request.URL.Path,
22 c.GetString("account"), statusCode)
23
24 c.JSON(statusCode, response)
25}
26
27// respondSuccess 返回成功响应
28func respondSuccess(c *gin.Context, data any, message string) {

Callers 13

errorHandlingMiddlewareFunction · 0.85
getLoginQrcodeHandlerMethod · 0.85
deleteCookiesHandlerMethod · 0.85
publishHandlerMethod · 0.85
publishVideoHandlerMethod · 0.85
listFeedsHandlerMethod · 0.85
searchFeedsHandlerMethod · 0.85
getFeedDetailHandlerMethod · 0.85
userProfileHandlerMethod · 0.85
postCommentHandlerMethod · 0.85
replyCommentHandlerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected