MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / writeInboundError

Function writeInboundError

internal/serverapi/inbounds.go:287–293  ·  view source on GitHub ↗
(w http.ResponseWriter, err error)

Source from the content-addressed store, hash-verified

285}
286
287func writeInboundError(w http.ResponseWriter, err error) {
288 status := http.StatusInternalServerError
289 if errors.Is(err, inbounds.ErrInboundNotFound) {
290 status = http.StatusNotFound
291 }
292 writeJSON(w, status, map[string]any{"error": err.Error()})
293}
294
295func writeHostError(w http.ResponseWriter, err error) {
296 status := http.StatusInternalServerError

Callers 3

handleInboundRoutesMethod · 0.85
handleHostsMethod · 0.85
handleInboundUsersMethod · 0.85

Calls 2

writeJSONFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected