Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Improve error handling #123

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mourtisma
Copy link

@mourtisma mourtisma commented Feb 25, 2020

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
Copy link
Author

@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
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant