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

Improve Error Handling to Include Full Stack Trace #1118

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

similato87
Copy link
Collaborator

@similato87 similato87 commented Apr 14, 2024

This PR introduces an enhancement to our error handling mechanism in the handle_improve_mode function for issue #1110. Previously, when an exception was caught, only the top-level error message was printed. This made it difficult to debug issues, especially those involving nested exceptions.

Changes include:

  • Importing the traceback module to enable printing of full stack traces.
  • Modifying the except block in the handle_improve_mode function to print the full stack trace of exceptions.
  • Adding a test case in test_steps.py to verify that the full stack trace is printed for multi-layer exceptions.

Ellipsis 🚀 This PR description was created by Ellipsis for commit 95e2e7a.

Summary:

This PR enhances error handling in the handle_improve_mode function by printing full stack traces of exceptions and adds a corresponding test case.

Key points:

  • Imported traceback module in /gpt_engineer/core/default/steps.py.
  • Modified except block in handle_improve_mode function to print full stack trace of exceptions.
  • Added a test case in /tests/core/default/test_steps.py to verify full stack trace printing for multi-layer exceptions.

Generated with ❤️ by ellipsis.dev

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested.

  • Reviewed the entire pull request up to 95e2e7a
  • Looked at 64 lines of code in 2 files
  • Took 44 seconds to review
More info
  • Skipped 0 files when reviewing.
  • Skipped posting 0 additional comments because they didn't meet confidence threshold of 50%.

Workflow ID: wflow_UZjDCK4HTk3YlOfr


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. We'll respond in a few minutes. Learn more here.

"Change the program to print 'Goodbye, World!' instead of 'Hello, World!'"
)

try:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test case 'test_handle_improve_mode_multilayer_error_trace' is not correctly testing the functionality of the 'handle_improve_mode' function. The test case is expecting an exception to be raised, but the 'handle_improve_mode' function is designed to catch all exceptions and print their stack trace, not to raise them. Therefore, the test case will always fail as it is currently written.

@captivus
Copy link
Collaborator

captivus commented Apr 18, 2024

It looks to me like the full stack trace is now being dumped to stdout, when errors are encountered in improve mode, which is the requested behavior.

image

@AntonOsika if you're good with the above, this should be ready to merge. #1110

@viborc viborc merged commit 2a5546b into main Apr 25, 2024
6 checks passed
@viborc viborc deleted the 1110-hot-fix-for-restoring-strack-trace branch April 25, 2024 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Getting "Could not resolve authentication method" – without a stacktrace
3 participants