Improve error handling
Referenced Issue: #122
This PR tackles the following code improvements
-
When configuring the ET_Client, loading the WSDL and refreshing the token, the current code only raise base Exceptions, which are not ideal to handle for developers => Create a base class for exceptions raised by the
ET_Client, and subclasses for the different scenarios (configuration, loading WSDL, token refresh) -
Potential HTTP errors coming from
requestsare not properly handled => UseResponse.raise_for_statusto handle HTTP error responses coming from requests -
In the
ET_Clientparams,applicationType, if notNoneor blank, can be anything => Handle that case properly, and raise a newConfigurationExceptionin case of unallowed value
I also added tests for these error scenarios, in a specific file, FuelSDK/test_ET_Client_errors.py
@smunuswami @manivinesh
Hi everyone!
If you don't have time to look at this PR, feel free to ask someone else to do so.
I chose you two because you were my two first reviewer suggestions.
Thanks!
@smunuswami @manivinesh Hi everyone. This PR has been opened for months, now.
Can someone please have a look (or suggest someone who could) at it ? Thank you :)