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 connection to server can not be established. #553

Closed
galaxog opened this issue Oct 7, 2020 · 2 comments
Closed

JSONDecodeError when connection to server can not be established. #553

galaxog opened this issue Oct 7, 2020 · 2 comments
Assignees
Labels

Comments

@galaxog
Copy link

galaxog commented Oct 7, 2020

When there is a connection issue the returned exception is confusing. Shouldn't the exception say something like server isn't available, or connection failed? I'm currently using version 4.6.0. If you try to use the client to connect to a bogus socket server like http://google.com, you should see the same exception I am seeing.

@miguelgrinberg
Copy link
Owner

Oh, this is odd, I wasn't aware of this. Okay, I'm going to fix it so that you get the intended exception, which should be this:

Traceback (most recent call last):
  File "client.py", line 18, in <module>
    sio.connect('http://google.com')
  File "socketio/client.py", line 286, in connect
    six.raise_from(exceptions.ConnectionError(exc.args[0]), None)
  File "<string>", line 3, in raise_from
socketio.exceptions.ConnectionError: Unexpected status code 404 in server response

@miguelgrinberg
Copy link
Owner

miguelgrinberg commented Oct 7, 2020

Fixed in the python-engineio dependency. Can I ask you to install https://github.com/miguelgrinberg/python-engineio package from its master branch on GitHub and retest? Thanks!

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

No branches or pull requests

2 participants