MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / writeInternalError

Function writeInternalError

internal/server/server.go:1956–1959  ·  view source on GitHub ↗

writeInternalError logs the real error server-side and sends a generic message to the client. This prevents leaking SQL errors, file paths, and other internal details.

(w http.ResponseWriter, err error)

Source from the content-addressed store, hash-verified

1954// message to the client. This prevents leaking SQL errors, file paths,
1955// and other internal details.
1956func writeInternalError(w http.ResponseWriter, err error) {
1957 slog.Error("internal server error", "error", err)
1958 writeError(w, http.StatusInternalServerError, "internal_error", "An internal error occurred")
1959}
1960
1961// defaultJSONBodyLimit is the default cap applied to JSON request bodies
1962// by decodeJSON. Every /api/* POST/PATCH is comfortably small in practice

Calls 2

writeErrorFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected