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

JSONDecodeError when removing a customer #96

Open
fuzzylogic2000 opened this issue May 31, 2024 · 0 comments
Open

JSONDecodeError when removing a customer #96

fuzzylogic2000 opened this issue May 31, 2024 · 0 comments

Comments

@fuzzylogic2000
Copy link

gocardless-pro==1.49.0

When I delete a customer, the delete works, but the return fails.

Traceback (most recent call last):
  File ".../lib/python3.10/site-packages/requests/models.py", line 974, in json
    return complexjson.loads(self.text, **kwargs)
  File ".../lib/python3.10/site-packages/simplejson/__init__.py", line 514, in loads
    return _default_decoder.decode(s)
  File ".../lib/python3.10/site-packages/simplejson/decoder.py", line 386, in decode
    obj, end = self.raw_decode(s)
  File ".../lib/python3.10/site-packages/simplejson/decoder.py", line 416, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".../vendors_api.py", line 129, in <module>
    client.customers.remove(identity=bank_account.links.customer)
  File ".../lib/python3.10/site-packages/gocardless_pro/services/customers_service.py", line 149, in remove
    return self._resource_for(response)
  File ".../lib/python3.10/site-packages/gocardless_pro/services/base_service.py", line 68, in _resource_for
    data = api_response.body[self._envelope_key()]
  File ".../lib/python3.10/site-packages/gocardless_pro/api_response.py", line 24, in body
    return self._response.json()
  File ".../lib/python3.10/site-packages/requests/models.py", line 978, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I checked the response I get in customers_service.py line 147 and that looks fine: status_code=204 and empty content as the docs state it should look like.

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

No branches or pull requests

1 participant