vcatalano / py-authorize

A full-featured Python API for the Authorize.net payment gateway.
MIT License
42 stars 35 forks source link

Correct AttrDict.getattr exception to be AttributeError instead of KeyError #83

Closed aryeh closed 2 years ago

aryeh commented 2 years ago

Other libs fail when they try to getattr and it throws the wrong exception.

For instance, trying to save the full_response from an authorize Exception to MongoDB with pymongo yields an error because KeyError is never caught when getattr() is called on the fields. Had it been AttributeError as expected it wouldn't fail.

vcatalano commented 2 years ago

Thank you for your contribution to the project!