aws / aws-encryption-sdk-python

AWS Encryption SDK
https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/introduction.html
Apache License 2.0
234 stars 83 forks source link

Logging an exception instead of / and a `raise` pollutes the log with extra traceback. #615

Open ShubhamChaturvedi7 opened 11 months ago

ShubhamChaturvedi7 commented 11 months ago

Problem:

In many places in the SDK codebase, there are exception logging using the _LOGGER.exception. This logs the traceback of the exception. The encountered exception might then be bubbled up to the caller, or to the exit call which then again logs this exception. This causes duplicate logging at best, and confusion at worst since the exception message/type can be different.

Solution:

Clean up the logging, and use raise over logging the exception wherever possible.

Ref https://github.com/aws/aws-encryption-sdk-python/issues/566