-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Fix exception traceback to omit superfluous 'Backtrace' information #14975
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
Conversation
Fixes SeleniumHQ#9977 Filter out superfluous 'StackTrace' information from Selenium 4 exception tracebacks. * Add a check for an environment variable to conditionally include the stacktrace. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/SeleniumHQ/selenium/issues/9977?shareId=XXXX-XXXX-XXXX-XXXX).
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|
Thanks for rasing the PR, however we commented the code was going to stay as it was, is there any other motivation for this? |
|
Those stack traces are not useful for SLMs. |
| if self.screen: | ||
| exception_msg += "Screenshot: available via screen\n" | ||
| if self.stacktrace: | ||
| if self.stacktrace and os.getenv("INCLUDE_STACKTRACE"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if self.stacktrace and os.getenv("INCLUDE_STACKTRACE"): | |
| if self.stacktrace and not os.getenv("EXCLUDE_STACKTRACE"): |
Will this change be accepted?
|
You should be able to exclude those or train the SLM to ignore them. We don't want to change the code as we pass along the information the browser sends back. You should engage more with the Chrome folks in the open issue in their bug tracker. |
|
When will these stack traces be useful? |
User description
Fixes #9977
Filter out superfluous 'StackTrace' information from Selenium 4 exception tracebacks.
For more details, open the Copilot Workspace session.
PR Type
Bug fix
Description
INCLUDE_STACKTRACEto control stacktrace visibility in exceptionsChanges walkthrough 📝
exceptions.py
Add environment variable control for stacktrace displaypy/selenium/common/exceptions.py
osmodule__str__method to only include stacktrace whenINCLUDE_STACKTRACEenvironment variable is seterrorhandler.py
Implement stacktrace filtering functionalitypy/selenium/webdriver/remote/errorhandler.py
osmodulefilter_stacktracemethod to remove 'Backtrace' informationcheck_responseto filter stacktrace whenINCLUDE_STACKTRACEis not set