This repository was archived by the owner on Jan 20, 2024. It is now read-only.
Improve error handling#123
Open
mourtisma wants to merge 4 commits intosalesforce-marketingcloud:masterfrom
Open
Improve error handling#123mourtisma wants to merge 4 commits intosalesforce-marketingcloud:masterfrom
mourtisma wants to merge 4 commits intosalesforce-marketingcloud:masterfrom
Conversation
Author
|
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! |
Author
|
@smunuswami @manivinesh Hi everyone. Can someone please have a look (or suggest someone who could) at it ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
requestsare not properly handled=> Use
Response.raise_for_statusto handle HTTP error responses coming from requestsIn the
ET_Clientparams,applicationType, if notNoneor blank, can be anything=> Handle that case properly, and raise a new
ConfigurationExceptionin case of unallowed valueI also added tests for these error scenarios, in a specific file,
FuelSDK/test_ET_Client_errors.py