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

Cannot access to root cause of Py4JNetworkError Exception. #528

Open
MahsaSeifikar opened this issue Jul 20, 2023 · 0 comments
Open

Cannot access to root cause of Py4JNetworkError Exception. #528

MahsaSeifikar opened this issue Jul 20, 2023 · 0 comments

Comments

@MahsaSeifikar
Copy link

MahsaSeifikar commented Jul 20, 2023

It seems there is a bug in send_command function in 'java_gateway.py'. When an exception is raised the current version of code doesn't reveal the cause of exception


 except Py4JNetworkError as pne:
 if connection:
                reset = False
                if isinstance(pne.cause, socket.timeout):
                    reset = True
                connection.close(reset)
            if self._should_retry(retry, connection, pne):
                logging.info("Exception while sending command.", exc_info=True)
                response = self.send_command(command, binary=binary)
            else:
                logging.exception(
                    "Exception while sending command.")
                response = proto.ERROR

In my use case, I need to access to reason of exception in the answer in __call__ function in java_gateway.py.

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