-
Notifications
You must be signed in to change notification settings - Fork 637
Description
Describe the bug
When Bedrock model is deprecated from a region, SDK throws ValidationException instead of ResourceNotFoundException. This leads to confusion in error handling because according to SDK documentation.
Based on these definitions, the ResourceNotFoundException is more appropriate in this case. Also, note the ValidationException is recommended by Bedrock team to retry request when sessionId expires after 24 hours. When model not available, it can cause ThrottlingException if developer was not made through documentation.
- ResourceNotFoundException - The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException - Input validation failed. Check your request parameters and retry the request.
__
Expected Behavior
Here the model resource was removed from the region so it should throw ResourceNotFoundException.
Current Behavior
The SDK throws ValidationException
Reproduction Steps
- Configure and code RetrieveAndGenerate API
- Make a request using a model that is not available in the region for e.g. Titan Text Premier not available in us-west-2 as of now
- Note that the error thrown is ValidationException
Possible Solution
When Bedrock model resource is not available in the region then it should throw ResourceNotFoundException instead of ValidationException.
Additional Information/Context
No response
SDK version used
latest
Environment details (OS name and version, etc.)
Node 18