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

[Enhancement] Improve error handling in ET_Client instantiation #122

@mourtisma

Description

@mourtisma

Is your feature request related to a problem? Please describe

  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
  2. Potential HTTP errors coming from requests are not properly handled
  3. In the ET_Client params, applicationType, if not None or blank, can be anything

I already created a PR to improve those 3 points: #123

Solutions

  1. Create a base class for exceptions raised by the ET_Client, and subclasses for the different scenarios (configuration, loading WSDL, token refresh)
  2. Use Response.raise_for_status to handle HTTP error responses coming from requests
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions