MCPcopy Index your code
hub / github.com/0xUnixIO/pulse / writeNodeError

Function writeNodeError

internal/serverapi/api.go:838–844  ·  view source on GitHub ↗
(w http.ResponseWriter, err error)

Source from the content-addressed store, hash-verified

836}
837
838func writeNodeError(w http.ResponseWriter, err error) {
839 status := http.StatusUnprocessableEntity // 422,不被 Cloudflare 拦截
840 if errors.Is(err, nodes.ErrNodeNotFound) {
841 status = http.StatusNotFound
842 }
843 writeJSON(w, status, map[string]any{"error": err.Error()})
844}
845
846func writeMethodNotAllowed(w http.ResponseWriter, allow string) {
847 w.Header().Set("Allow", allow)

Callers 15

handleNodeMethod · 0.85
handleNodeRuntimeMethod · 0.85
handleNodeMetricsMethod · 0.85
handleNodeStatusMethod · 0.85
handleNodeConfigMethod · 0.85
handleNodeLogsMethod · 0.85
handleNodeLogsStreamMethod · 0.85
handleNodeUsageMethod · 0.85
handleNodeStartMethod · 0.85
handleNodeStopMethod · 0.85
handleNodeRestartMethod · 0.85
handleNodeApplyMethod · 0.85

Calls 2

writeJSONFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected