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

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