New to AWS & Boto3? Learn the best practices for handling errors & exceptions when using Boto3, the AWS SDK for Python: https://go.aws/30tWTHsOverviewAWS services require clients to use a variety of parameters, behaviors, or limits when interacting with their APIs. Boto3 provides many features to assist in navigating the errors and exceptions that you might encounter when interacting with AWS services. Specifically, this guide provides details on the following:
Why catch exceptions from AWS and Boto
Determining what exceptions to catchExceptions that you might encounter when using Boto3 will come from one of two sources: botocore or the AWS services your client is interacting with. Botocore exceptionsThese exceptions are statically defined within the botocore package, a dependency of Boto3. The exceptions are related to issues with client-side behaviors, configurations, or validations. You can generate a list of the statically defined botocore exceptions using the following code: import botocore.exceptions for key, value in sorted(botocore.exceptions.__dict__.items()): if isinstance(value, type): print(key)
|
Python >