FuelSDK-Python icon indicating copy to clipboard operation
FuelSDK-Python copied to clipboard

Improve error handling

Open mourtisma opened this issue 5 years ago • 2 comments

Referenced Issue: #122

This PR tackles the following code improvements

  1. 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)

  2. Potential HTTP errors coming from requests are not properly handled => Use Response.raise_for_status to handle HTTP error responses coming from requests

  3. In the ET_Client params, applicationType, if not None or blank, can be anything => Handle that case properly, and raise a new ConfigurationException in case of unallowed value

I also added tests for these error scenarios, in a specific file, FuelSDK/test_ET_Client_errors.py

mourtisma avatar Feb 25 '20 09:02 mourtisma

@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!

mourtisma avatar Mar 15 '20 21:03 mourtisma

@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 :)

mourtisma avatar May 08 '20 16:05 mourtisma