HENNGE / aiodynamo

Asynchronous, fast, pythonic DynamoDB Client
https://aiodynamo.readthedocs.io/
Other
69 stars 20 forks source link

How to handle exceptions? #103

Closed johnsyin closed 2 years ago

johnsyin commented 2 years ago

Was trying to migrate from botocore which provides exceptions module, is there an equivalent of botocore.exceptions.ClientError with error response message?

johnsyin commented 2 years ago

In fact, I was trying to do the same line of botocore table.get_item(Key={'PK': pk, 'SK': sk}) to await table.get_item(key={'PK': pk, 'SK': sk})

However, the request just hangs for about half a minute before it raises aiodynamo.http.base.RequestFailed. Perhaps there are something wrong in my client setup but it is hard to debug from the given exception

johnsyin commented 2 years ago

Ok turns out I was missing yarn.URL('http://localhost:8000'), now I can see errors raising from aiodynamo.errors, it maybe worth to include the available errors in docs

dimaqq commented 2 years ago

I think it would be nice to list all of https://github.com/HENNGE/aiodynamo/blob/master/src/aiodynamo/errors.py in documentation, specifically if the "expected" conditions are semantically significant. I guess it has not been a priority so far 🤷🏿