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

Function writeUserError

internal/serverapi/users.go:634–640  ·  view source on GitHub ↗
(w http.ResponseWriter, err error)

Source from the content-addressed store, hash-verified

632}
633
634func writeUserError(w http.ResponseWriter, err error) {
635 status := http.StatusInternalServerError
636 if errors.Is(err, users.ErrUserNotFound) {
637 status = http.StatusNotFound
638 }
639 writeJSON(w, status, map[string]any{"error": err.Error()})
640}
641
642func writeUserInboundError(w http.ResponseWriter, err error) {
643 status := http.StatusInternalServerError

Callers 6

handleUserMethod · 0.85
handleUpdateUserMethod · 0.85
handleUserInboundsMethod · 0.85
handleUserCredentialsMethod · 0.85

Calls 2

writeJSONFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected