Skip to content

[py]: return message as part of exception in execute method - #15751

Merged
p0deje merged 3 commits into
SeleniumHQ:trunkfrom
navin772:ws-exception
May 20, 2025
Merged

p0deje merged 3 commits into
SeleniumHQ:trunkfrom
navin772:ws-exception

Conversation

@navin772

@navin772 navin772 commented May 19, 2025 •

Copy link
Copy Markdown
Member

User description

🔗 Related Issues

💥 What does this PR do?

Returns a meaningful error and message when an exception is raised in the WebSocketConnection execute method.

Earlier only 'error': 'unknown error' exception was raised which doesn't provides any good error message.

Now, its much better:

Exception: unknown error: No such file or directory: /private/var/tmp/_bazel_navinchandra/a5b294e127f7c14e5d2a4b14aeba0f68/....

🔧 Implementation Notes

💡 Additional Considerations

🔄 Types of changes

  • Bug fix (backwards compatible)

PR Type

Bug fix


Description

  • Improve exception handling in WebSocketConnection execute

  • Include error message in raised exceptions for clarity

  • Enhance debugging by surfacing server-side error details


Changes walkthrough 📝

Relevant files
Bug fix
websocket_connection.py
Enhance exception message handling in WebSocketConnection

py/selenium/webdriver/remote/websocket_connection.py

  • Enhanced exception to include error message if present
  • Now raises detailed error combining 'error' and 'message' fields
  • Improves clarity of exceptions from WebSocket responses
  • +6/-1     

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Loading
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    4 participants