sweepai / sweep

Sweep: open-source AI-powered Software Developer for small features and bug fixes.
https://sweep.dev
Other
7.43k stars 425 forks source link

Sweep: Include traceback in error logs in api.py #1773

Open sweep-nightly[bot] opened 1 year ago

sweep-nightly[bot] commented 1 year ago

In the file sweepai/api.py, the error logs during exceptions do not include traceback information. This makes it harder to debug the source of the error.

For example, in the function terminate_thread, the exception is logged without traceback:

except Exception as e:
    logger.error(f"Failed to terminate thread: {e}")

To include traceback information, you can use the traceback module in Python. Here's an example of how you can modify the code:

import traceback
...
except Exception as e:
    logger.error(f"Failed to terminate thread: {e}\n{traceback.format_exc()}")

Please apply this change to all instances where exceptions are logged in this file.

sweep-nightly[bot] commented 1 year ago
Sweeping

0%
💎 Sweep Pro: I'm creating this ticket using GPT-4. You have unlimited GPT-4 tickets.

Actions (click)


I am currently looking into this ticket! I will update the progress of the ticket in this comment. I am currently searching through your code, looking for relevant snippets.


Step 1: 🔎 Searching

I'm searching for relevant snippets in your repository. If this is your first time using Sweep, I'm indexing your repository. This may take up to 5 minutes. I'll let you know when I'm done.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord