feat: enhance exception handling and issue reporting

This commit is contained in:
Paul Gauthier 2024-08-29 09:27:14 -07:00 committed by Paul Gauthier (aider)
parent 9d1df5308d
commit 29cf1e322e

View file

@ -28,6 +28,7 @@ def report_github_issue(issue_text, title=None):
print(f"\n# {title}\n") print(f"\n# {title}\n")
print(issue_text.strip()) print(issue_text.strip())
print() print()
print("Please consider reporting this bug to help improve aider!")
prompt = "Report this as a GitHub Issue using your browser? (Y/n) " prompt = "Report this as a GitHub Issue using your browser? (Y/n) "
confirmation = input(prompt).strip().lower() confirmation = input(prompt).strip().lower()
@ -51,6 +52,9 @@ def report_github_issue(issue_text, title=None):
def exception_handler(exc_type, exc_value, exc_traceback): def exception_handler(exc_type, exc_value, exc_traceback):
# We don't want any more exceptions
sys.excepthook = None
# Format the traceback # Format the traceback
tb_lines = traceback.format_exception(exc_type, exc_value, exc_traceback) tb_lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
tb_text = "".join(tb_lines) tb_text = "".join(tb_lines)