This repository has been archived by the owner on Jan 20, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
requests
are not properly handled=> Use
Response.raise_for_status
to handle HTTP error responses coming from requestsIn the
ET_Client
params,applicationType
, if notNone
or blank, can be anything=> Handle that case properly, and raise a new
ConfigurationException
in case of unallowed valueI also added tests for these error scenarios, in a specific file,
FuelSDK/test_ET_Client_errors.py