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

[FLAPI-2083] Fix HTTP client API error usage #55

Merged
merged 3 commits into from
Jan 5, 2022

Conversation

jesse-c
Copy link
Contributor

@jesse-c jesse-c commented Jan 4, 2022

The arguments are now the appropriate header list (though empty) and error (as a list).

The message argument is removed too as we implicitly get it from the first error.

Jesse Claven added 3 commits January 4, 2022 16:51
The arguments are now the appropriate header list (though empty) and
error (as a list).
@jesse-c jesse-c requested a review from a team January 4, 2022 16:55
@jesse-c jesse-c requested a review from a team as a code owner January 4, 2022 16:55
@jesse-c jesse-c requested a review from zuburqan January 4, 2022 16:55
@jesse-c jesse-c self-assigned this Jan 4, 2022
@jesse-c jesse-c requested a review from sgerrand January 4, 2022 16:55
@jesse-c jesse-c changed the title Correct HTTP client API error usage Fix HTTP client API error usage Jan 4, 2022
@jesse-c jesse-c changed the title Fix HTTP client API error usage [FLAPI-2040] Fix HTTP client API error usage Jan 4, 2022
Copy link
Contributor

@sgerrand sgerrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, no blockers. 👍

@@ -12,7 +14,7 @@ class ClientError(Exception):
class ApiError(Exception):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💭 We should probably add unit tests for this class and others in this file at some future point.

@sgerrand sgerrand force-pushed the correct-http-client-api-error-usage branch 2 times, most recently from ee16973 to fd6d5f7 Compare January 5, 2022 11:21
@sgerrand
Copy link
Contributor

sgerrand commented Jan 5, 2022

Looks correct locally:

$ npx pyright duffel_api/http_client.py
No configuration file found.
pyproject.toml file found at .
Loading pyproject.toml file at ./pyproject.toml
Assuming Python platform Darwin
Auto-excluding **/node_modules
Auto-excluding **/__pycache__
Auto-excluding .git
stubPath ./typings is not a valid directory.
Search paths for .
  ./node_modules/pyright/dist/typeshed-fallback/stdlib
  .
  ./typings
  ./node_modules/pyright/dist/typeshed-fallback/stubs/...
  ~/.pyenv/versions/3.6.15/lib/python3.6
  ~/.pyenv/versions/3.6.15/lib/python3.6/lib-dynload
  ~/.pyenv/versions/3.6.15/envs/duffel-api-python-pyright/lib/python3.6/site-packages
Searching for source files
Found 1 source file
./duffel_api/http_client.py
  ./duffel_api/http_client.py:4:6 - warning: Import "requests" could not be resolved from source (reportMissingModuleSource)
  ./duffel_api/http_client.py:5:6 - warning: Import "requests" could not be resolved from source (reportMissingModuleSource)
0 errors, 2 warnings, 0 infos 
Completed in 0.692sec

@sgerrand sgerrand force-pushed the correct-http-client-api-error-usage branch from fd6d5f7 to 1564e26 Compare January 5, 2022 11:31
@jesse-c jesse-c merged commit c8e2062 into main Jan 5, 2022
@jesse-c jesse-c deleted the correct-http-client-api-error-usage branch January 5, 2022 12:00
@jesse-c jesse-c changed the title [FLAPI-2040] Fix HTTP client API error usage [FLAPI-2083] Fix HTTP client API error usage Jan 6, 2022
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.

2 participants