fix: STS error translation to API error (#16683)

This commit is contained in:
Poorna 2023-02-21 20:27:48 -08:00 committed by GitHub
parent 8bfe972bab
commit 59a5456091
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ func writeSTSErrorResponse(ctx context.Context, w http.ResponseWriter, isErrCode
err = stsErrCodes.ToSTSErr(errCode) err = stsErrCodes.ToSTSErr(errCode)
} }
if err.Code == "InternalError" || !isErrCodeSTS { if err.Code == "InternalError" || !isErrCodeSTS {
aerr := getAPIError(APIErrorCode(errCode)) aerr := errorCodes.ToAPIErr(toAPIErrorCode(ctx, errCtxt))
if aerr.Code != "InternalError" { if aerr.Code != "InternalError" {
err.Code = aerr.Code err.Code = aerr.Code
err.Description = aerr.Description err.Description = aerr.Description