fix: avoid printing certain errors under few locations (#16631)

This commit is contained in:
Harshavardhana authored and GitHub committed 2023-02-17 01:40:31 -08:00
1 parent a7188bc9d0
commit 6ea150fd68
5 files changed
+22 -19

No files matched your search

+5
View File
@@ -82,6 +82,11 @@ func (a kmsAPIHandlers) KMSMetricsHandler(w http.ResponseWriter, r *http.Request
return
}
if _, ok := GlobalKMS.(kms.KeyManager); !ok {
writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(ErrNotImplemented), r.URL)
return
}
metrics, err := GlobalKMS.Metrics(ctx)
if err != nil {
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)