sts: Avoid printing all STS errors (#15065)

Limit printing STS errors to 

- STS internal error
- STS not initialized
- STS upstream error
This commit is contained in:
Anis Elleuch
2022-06-11 20:55:32 +01:00
committed by GitHub
parent 21526efe51
commit dd53b287f2

View File

@@ -48,14 +48,10 @@ func writeSTSErrorResponse(ctx context.Context, w http.ResponseWriter, isErrCode
if errCtxt != nil {
stsErrorResponse.Error.Message = errCtxt.Error()
}
var logKind logger.Kind
switch errCode {
case ErrSTSInternalError, ErrSTSNotInitialized:
logKind = logger.Minio
default:
logKind = logger.All
case ErrSTSInternalError, ErrSTSNotInitialized, ErrSTSUpstreamError:
logger.LogIf(ctx, errCtxt, logger.Minio)
}
logger.LogIf(ctx, errCtxt, logKind)
encodedErrorResponse := encodeResponse(stsErrorResponse)
writeResponse(w, err.HTTPStatusCode, encodedErrorResponse, mimeXML)
}