MCPcopy
hub / github.com/acepanel/panel / Error

Function Error

internal/service/helper.go:37–48  ·  view source on GitHub ↗

Error 响应错误

(w http.ResponseWriter, code int, format string, args ...any)

Source from the content-addressed store, hash-verified

35
36// Error 响应错误
37func Error(w http.ResponseWriter, code int, format string, args ...any) {
38 render := chix.NewRender(w)
39 defer render.Release()
40 render.Header(chix.HeaderContentType, chix.MIMEApplicationJSONCharsetUTF8) // must before Status()
41 render.Status(code)
42 if len(args) > 0 {
43 format = fmt.Sprintf(format, args...)
44 }
45 render.JSON(&ErrorResponse{
46 Msg: format,
47 })
48}
49
50// ErrorSystem 响应系统错误
51func ErrorSystem(w http.ResponseWriter) {

Callers 15

GetConfigMethod · 0.92
UpdateConfigMethod · 0.92
GetUserConfigMethod · 0.92
UpdateUserConfigMethod · 0.92
LoadMethod · 0.92
LogMethod · 0.92
GetPostgresPasswordMethod · 0.92
SetPostgresPasswordMethod · 0.92
GetConfigTuneMethod · 0.92
UpdateConfigTuneMethod · 0.92
UpdateConfigMethod · 0.92
UpdateConfigTuneMethod · 0.92

Calls 1

StatusMethod · 0.65

Tested by

no test coverage detected