On Fri, Apr 20, 2012 at 10:16 AM, Michael Hanselmann <[email protected]>wrote:
> Am 20. April 2012 10:24 schrieb Chris Schrier <[email protected]>: > > This change will allow RAPI client users to catch a single exception, > > GanetiApiError. Additionally, this exposed the PycRL error in the > exception > > so it may be examined. > > Both CertificateError and GanetiApiError have “Error” as a base class. > Why don't those client users catch “Error”? > > > - Michael > > To be honest, I'm not sure why CertificateError was used in this single location. GanetiApiError is the standard exception raised - 9 times currently. Users could catch Error; however, GanetiApiError adds a "code" attribute which is useful for determining the exact error type. If clients catch Error then they must also check for the code attribute which does not seem ideal. I'd prefer removing the CertificateError exception in favor of raising GanetiApiError with the PycURL exception but I did not want to change the method signature.
