- Más nuevo
- Más votos
- Más comentarios
If you're looking to provide more details on the errors in ClientErrors, you can check the Error nested dictionary that appears with the ResponseMetadata nested dictionary. One thing to keep in mind is that Boto3 classifies all AWS service errors and exceptions as ClientError exceptions as well.
However, if you're looking for exceptions while using a resource client, that may be slightly different as catching exceptions and errors is a similar experience to using a low-level client for certain AWS services. For these, parsing may look different for error responses as you’ll need to access the client’s meta property to get to the exceptions such as client.meta.client.exceptions.<insert-exception-here>.
For more information, check out: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/error-handling.html
Contenido relevante
- OFICIAL DE AWSActualizada hace 2 años
- OFICIAL DE AWSActualizada hace 2 años
Maybe I should ask this. I have a client set up like this: s3 = boto3.client('s3').
Why doesn't an "except botocore.exceptions.ClientError as err" statement catch botocore.exceptions.EndpointConnectionError errors or botocore.exceptions.ConnectionClosedError errors? Shouldn't they be caught? they are from the service, right?
Nevermind. I found what I was looking for in your response. The botocore exceptions are listed here. https://github.com/boto/botocore/blob/develop/botocore/exceptions.py Thanks.