Skip to content

JSONDecodeError when calling tax_for_order #34

@exonjoe

Description

@exonjoe

There have been 2 brief occasions in the past week where we've received JSONDecodeErrors when calling the tax_for_order endpoint:

  File "taxjar/client.py", line 43, in tax_for_order
    return self.responder(request)
  File "taxjar/response.py", line 7, in from_request
    return TaxJarResponse().data_from_request(request)
  File "taxjar/response.py", line 10, in data_from_request
    response = request.json()
  File "requests/models.py", line 910, in json
    return complexjson.loads(self.text, **kwargs)
  File "json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Both occasions were very brief (under 45 seconds) so it's not been possible to reproduce the issue. It seems similar to #9. It could be that the API is returning non-JSON data in some situations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions