-
Notifications
You must be signed in to change notification settings - Fork 27
Closed
Labels
bugSomething isn't working. It's clear that this does need to be fixed.Something isn't working. It's clear that this does need to be fixed.
Description
Publishing a message on an invalid channel causes the SDK to fail to decode the error response appropriately. Example error log:
####### TEXT ��error��message�resource: invalid name ":"�href� https://help.ably.io/error/40010�code��J�statusCode��
Traceback (most recent call last):
File "/home/void/.pyenv/versions/klash/lib/python3.11/site-packages/ably/sync/util/exceptions.py", line 38, in raise_for_response
json_response = response.json()
^^^^^^^^^^^^^^^
File "/home/void/.pyenv/versions/klash/lib/python3.11/site-packages/httpx/_models.py", line 766, in json
return jsonlib.loads(self.content, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/void/.pyenv/versions/3.11.4/lib/python3.11/json/__init__.py", line 341, in loads
s = s.decode(detect_encoding(s), 'surrogatepass')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x81 in position 0: invalid start byte
Reproduction Steps
Publish a message to the ":" channel (or any other invalid channel)
Expected Behaviour
The SDK should correctly decode and return the 40010 error.
Additional Notes:
It's worth triggering a couple of other error codes within the SDK to see if they are decoded appropriately, just to ensure this decoding issue is not a widespread problem.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't working. It's clear that this does need to be fixed.Something isn't working. It's clear that this does need to be fixed.