MCPcopy Create free account
hub / github.com/AbelChe/evil_minio / writeErrorResponseJSON

Function writeErrorResponseJSON

cmd/api-response.go:896–901  ·  view source on GitHub ↗

writeErrorResponseJSON - writes error response in JSON format; useful for admin APIs.

(ctx context.Context, w http.ResponseWriter, err APIError, reqURL *url.URL)

Source from the content-addressed store, hash-verified

894// writeErrorResponseJSON - writes error response in JSON format;
895// useful for admin APIs.
896func writeErrorResponseJSON(ctx context.Context, w http.ResponseWriter, err APIError, reqURL *url.URL) {
897 // Generate error response.
898 errorResponse := getAPIErrorResponse(ctx, err, reqURL.Path, w.Header().Get(xhttp.AmzRequestID), w.Header().Get(xhttp.AmzRequestHostID))
899 encodedErrorResponse := encodeResponseJSON(errorResponse)
900 writeResponse(w, err.HTTPStatusCode, encodedErrorResponse, mimeJSON)
901}
902
903// writeCustomErrorResponseJSON - similar to writeErrorResponseJSON,
904// but accepts the error message directly (this allows messages to be

Callers 15

KMSStatusHandlerMethod · 0.85
KMSMetricsHandlerMethod · 0.85
KMSAPIsHandlerMethod · 0.85
KMSVersionHandlerMethod · 0.85
KMSCreateKeyHandlerMethod · 0.85
KMSDeleteKeyHandlerMethod · 0.85
KMSListKeysHandlerMethod · 0.85
KMSImportKeyHandlerMethod · 0.85
KMSKeyStatusHandlerMethod · 0.85

Calls 5

getAPIErrorResponseFunction · 0.85
encodeResponseJSONFunction · 0.85
writeResponseFunction · 0.85
GetMethod · 0.65
HeaderMethod · 0.45

Tested by

no test coverage detected