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

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

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)