aws / aws-sdk

Landing page for the AWS SDKs on GitHub
https://aws.amazon.com/tools/
Other
71 stars 14 forks source link

No ThrottlingException class in ECS client #821

Open himat opened 4 days ago

himat commented 4 days ago

The ECS client does not expose ThrottlingException for some reason.

khushail commented 2 days ago

Hi @himat , thanks for reaching out.

I see that ThrottlingException error code is being mentioned in ECS Client API Docs. You could use that in your API Call.

Sharing some other references - https://docs.aws.amazon.com/AmazonECS/latest/developerguide/operating-at-scale-dealing-with-throttles.html https://docs.aws.amazon.com/AmazonECS/latest/APIReference/request-throttling.html#throttling-how

It would really be helpful if you could please share information stated below -

  1. Your usecase for exposure of this class
  2. Are you looking for any particular language SDK usage here

Thanks.

himat commented 1 day ago
  1. Usecase is to match on this error class using instanceof instead of checking error.name === "ThrottlingException"
  2. For typescript/javascript SDK
khushail commented 1 day ago

Thanks for replying @himat . Looks like this is meant to be with JS Team. Reaching out to JS on call for further action

RanVaknin commented 1 day ago

Hi @himat ,

The reason the SDK does not have a concrete type for ThrottlingException is because the ECS service team never defined it in their API model. You can cmd + f to search in this API model to see that it doesn't exist. This API model is the source file that the SDKs are generated from, and is defined upstream by the service team (cannot be edited directly).

We can open a feature request with the service team to add this to their model as a modeled exception, for the sake of transparency I'd say that this would likely be classified as a lower priority issue and might not be implemented any time soon.

Since you are using the JS SDK, you can safely use error.name even if a concrete type of an error has not been defined as the error is unlikely to change.

Thanks, Ran~

V1528678655