sweepai / sweep

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

Sweep: Use traceback for logging exceptions in sweepai/core/sweep_bot.py #1792

Open sweep-nightly[bot] opened 1 year ago

sweep-nightly[bot] commented 1 year ago

In the file sweepai/core/sweep_bot.py, exceptions are caught and logged without using traceback. This makes it harder to debug issues as the stack trace is not logged.

For example, in the get_files_to_change method, exceptions are caught and logged without using traceback.

except Exception as e:
    logger.warning(f"Exception {e_str}. Failed to parse! Retrying...")
    self.delete_messages_from_chat("pull_request")
    continue

The logger.warning should be replaced with logger.error and include traceback.format_exc() to log the full stack trace.

except Exception as e:
    logger.error(f"Exception {e_str}. Failed to parse! Retrying...\n{traceback.format_exc()}")
    self.delete_messages_from_chat("pull_request")
    continue

Please make this change throughout the file to improve error logging.

sweep-nightly[bot] commented 1 year ago
Sweeping

0%

Actions (click)


❌ Unable to Complete PR

It looks like an issue has occurred around fetching the files. Perhaps the repo has not been initialized. If this error persists contact team@sweep.dev.

@sweep-nightly[bot], editing this issue description to include more details will automatically make me relaunch.

For bonus GPT-4 tickets, please report this bug on Discord.


🎉 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.