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

Connection Manager get_socket() will return exception without message #206

Open
jake1164 opened this issue Nov 30, 2024 · 1 comment
Open

Comments

@jake1164
Copy link

In def request() line 633 I am getting an exception thrown at
socket = self._connection_manager.get_socket(
however there is no message with the exception making it difficult to know why its failing.

This is on a Pico W and most likely due to an API call that is too large my best guess and so I would recommend adding a try and when the exception is thrown checking if the message is blank and adding one to the throw so the call to the request knows where it failed.

Something along the lines of

        while retry_count < 2:
            retry_count += 1
            try:
                socket = self._connection_manager.get_socket(
                    host,
                    port,
                    proto,
                    session_id=self._session_id,
                    timeout=timeout,
                    ssl_context=self._ssl_context,
                )
            except Exception as exc:
                print('connection_manager.get_socket',exc)
                # raise exception but add message if its empty
                if not str(exc):
                    raise RuntimeError("Failed to get socket") from exc
                ```
@jake1164
Copy link
Author

After tracing it looks like its an ssl issue not a file size issue. However, an meaningful message when raised would be nice one way or the other.

adafruit/Adafruit_CircuitPython_ConnectionManager#22

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