MCPcopy
hub / github.com/Wei-Shaw/sub2api / Error

Function Error

backend/internal/pkg/response/response.go:60–67  ·  view source on GitHub ↗

Error 返回错误响应

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

Source from the content-addressed store, hash-verified

58
59// Error 返回错误响应
60func Error(c *gin.Context, statusCode int, message string) {
61 c.JSON(statusCode, Response{
62 Code: statusCode,
63 Message: message,
64 Reason: "",
65 Metadata: nil,
66 })
67}
68
69// ErrorWithDetails returns an error response compatible with the existing envelope while
70// optionally providing structured error fields (reason/metadata).

Callers 6

TestErrorFunction · 0.85
BadRequestFunction · 0.85
UnauthorizedFunction · 0.85
ForbiddenFunction · 0.85
NotFoundFunction · 0.85
InternalErrorFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestErrorFunction · 0.68