Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(utils): handles Retry-After header as str value. #29

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anthonyalmarza
Copy link

We have an issue currently in our staging environment where the sdk is obfuscating the API rate limiting issue that we've run into.

The following is the error we're seeing.

TypeError: '>' not supported between instances of 'str' and 'int'
  File "rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "swap/transactions/views.py", line 125, in checkout
    obj.initialize_checkout(self.request.retailer)
  File "swap/transactions/models.py", line 623, in initialize_checkout
    if not self.get_shipping_address_for_participant(retailer).address_is_valid():
  File "swap/contacts/models.py", line 217, in address_is_valid
    return ShipmentApi.validate_shipping_address(self, save=save)
  File "swap/shipments/shipengine.py", line 110, in validate_shipping_address
    if return_value := self.validate_formatted_address(formatted_address):
  File "swap/shipments/shipengine.py", line 103, in validate_formatted_address
    return self.shipengine.validate_addresses([formatted_address])
  File "shipengine/shipengine.py", line 142, in validate_addresses
    return self.client.post(
  File "shipengine/http_client/client.py", line 61, in post
    return self._request_loop(
  File "shipengine/http_client/client.py", line 104, in _request_loop
    raise err
  File "shipengine/http_client/client.py", line 87, in _request_loop
    api_response = self._send_request(
  File "shipengine/http_client/client.py", line 145, in _send_request
    check_response_for_errors(
  File "shipengine/util/sdk_assertions.py", line 204, in check_response_for_errors
    if retry_after > config.timeout:

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

Successfully merging this pull request may close these issues.

1 participant