Skip to content

Commit 2efe31e

Browse files
Updated error handling for RegisterOrganizationAdminAccount API to properly translate TooManyExceptions to HTTP 429 status code. This enhancement improves error handling consistency and provides clearer feedback when request limits are exceeded.
1 parent 5af7773 commit 2efe31e

File tree

7 files changed

+26
-2
lines changed

7 files changed

+26
-2
lines changed

generator/ServiceModels/auditmanager/auditmanager-2017-07-25.api.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,8 @@
750750
{"shape":"ValidationException"},
751751
{"shape":"AccessDeniedException"},
752752
{"shape":"InternalServerException"},
753-
{"shape":"ResourceNotFoundException"}
753+
{"shape":"ResourceNotFoundException"},
754+
{"shape":"ThrottlingException"}
754755
]
755756
},
756757
"StartAssessmentFrameworkShare":{

generator/ServiceModels/auditmanager/auditmanager-2017-07-25.normal.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,8 @@
799799
{"shape":"ValidationException"},
800800
{"shape":"AccessDeniedException"},
801801
{"shape":"InternalServerException"},
802-
{"shape":"ResourceNotFoundException"}
802+
{"shape":"ResourceNotFoundException"},
803+
{"shape":"ThrottlingException"}
803804
],
804805
"documentation":"<p> Enables an Amazon Web Services account within the organization as the delegated administrator for Audit Manager. </p>"
805806
},

sdk/src/Services/AuditManager/Generated/Model/Internal/MarshallTransformations/RegisterOrganizationAdminAccountResponseUnmarshaller.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ public override AmazonServiceException UnmarshallException(JsonUnmarshallerConte
101101
{
102102
return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse, ref readerCopy);
103103
}
104+
if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottlingException"))
105+
{
106+
return ThrottlingExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse, ref readerCopy);
107+
}
104108
if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException"))
105109
{
106110
return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse, ref readerCopy);

sdk/src/Services/AuditManager/Generated/_bcl/AmazonAuditManagerClient.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4198,6 +4198,9 @@ public virtual RegisterAccountResponse RegisterAccount(RegisterAccountRequest re
41984198
/// <exception cref="Amazon.AuditManager.Model.ResourceNotFoundException">
41994199
/// The resource that's specified in the request can't be found.
42004200
/// </exception>
4201+
/// <exception cref="Amazon.AuditManager.Model.ThrottlingException">
4202+
/// The request was denied due to request throttling.
4203+
/// </exception>
42014204
/// <exception cref="Amazon.AuditManager.Model.ValidationException">
42024205
/// The request has invalid or missing parameters.
42034206
/// </exception>
@@ -4233,6 +4236,9 @@ public virtual RegisterOrganizationAdminAccountResponse RegisterOrganizationAdmi
42334236
/// <exception cref="Amazon.AuditManager.Model.ResourceNotFoundException">
42344237
/// The resource that's specified in the request can't be found.
42354238
/// </exception>
4239+
/// <exception cref="Amazon.AuditManager.Model.ThrottlingException">
4240+
/// The request was denied due to request throttling.
4241+
/// </exception>
42364242
/// <exception cref="Amazon.AuditManager.Model.ValidationException">
42374243
/// The request has invalid or missing parameters.
42384244
/// </exception>

sdk/src/Services/AuditManager/Generated/_bcl/IAmazonAuditManager.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3345,6 +3345,9 @@ public partial interface IAmazonAuditManager : IAmazonService, IDisposable
33453345
/// <exception cref="Amazon.AuditManager.Model.ResourceNotFoundException">
33463346
/// The resource that's specified in the request can't be found.
33473347
/// </exception>
3348+
/// <exception cref="Amazon.AuditManager.Model.ThrottlingException">
3349+
/// The request was denied due to request throttling.
3350+
/// </exception>
33483351
/// <exception cref="Amazon.AuditManager.Model.ValidationException">
33493352
/// The request has invalid or missing parameters.
33503353
/// </exception>
@@ -3374,6 +3377,9 @@ public partial interface IAmazonAuditManager : IAmazonService, IDisposable
33743377
/// <exception cref="Amazon.AuditManager.Model.ResourceNotFoundException">
33753378
/// The resource that's specified in the request can't be found.
33763379
/// </exception>
3380+
/// <exception cref="Amazon.AuditManager.Model.ThrottlingException">
3381+
/// The request was denied due to request throttling.
3382+
/// </exception>
33773383
/// <exception cref="Amazon.AuditManager.Model.ValidationException">
33783384
/// The request has invalid or missing parameters.
33793385
/// </exception>

sdk/src/Services/AuditManager/Generated/_netstandard/AmazonAuditManagerClient.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2892,6 +2892,9 @@ internal virtual RegisterOrganizationAdminAccountResponse RegisterOrganizationAd
28922892
/// <exception cref="Amazon.AuditManager.Model.ResourceNotFoundException">
28932893
/// The resource that's specified in the request can't be found.
28942894
/// </exception>
2895+
/// <exception cref="Amazon.AuditManager.Model.ThrottlingException">
2896+
/// The request was denied due to request throttling.
2897+
/// </exception>
28952898
/// <exception cref="Amazon.AuditManager.Model.ValidationException">
28962899
/// The request has invalid or missing parameters.
28972900
/// </exception>

sdk/src/Services/AuditManager/Generated/_netstandard/IAmazonAuditManager.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1928,6 +1928,9 @@ public partial interface IAmazonAuditManager : IAmazonService, IDisposable
19281928
/// <exception cref="Amazon.AuditManager.Model.ResourceNotFoundException">
19291929
/// The resource that's specified in the request can't be found.
19301930
/// </exception>
1931+
/// <exception cref="Amazon.AuditManager.Model.ThrottlingException">
1932+
/// The request was denied due to request throttling.
1933+
/// </exception>
19311934
/// <exception cref="Amazon.AuditManager.Model.ValidationException">
19321935
/// The request has invalid or missing parameters.
19331936
/// </exception>

0 commit comments

Comments
 (0)