pyze icon indicating copy to clipboard operation
pyze copied to clipboard

Replace RuntimeErrors in Gigya with appropiate (sub)classed Errors

Open mfonville opened this issue 4 years ago • 2 comments

At the moment, anything that goes wrong during the Gigya login process throws the same generic RuntimeError. This makes it for users of the API impossible to detect (and catch) if e.g. just login username/password supplied by the user is wrong, or if there is something else broken in e.g. a dependency.

Could we please change the error types, they could be a subclass of RuntimeError for more generic usage and backwards compatibility? A good example of exceptions usage is the Requests-library: https://requests.readthedocs.io/en/master/_modules/requests/exceptions/

My proposal would be a new exception class: GigyaException(RuntimeError) Something similar could also be done for Kamereon. (or a PyZEException, but imho it would be appropriate to have them separate)

mfonville avatar Aug 23 '20 21:08 mfonville

@jamesremuscat I would like to have some feedback how you feel about this, before I would make a PR :-)

mfonville avatar Aug 28 '20 20:08 mfonville

Hi @jamesremuscat Do you have a view on this?

epenet avatar Oct 27 '20 21:10 epenet