From f9d2acae545c58ea525a90d56c3ccce18f0575ae Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 15 Jun 2026 18:57:12 +0000 Subject: [PATCH 1/9] Auto-updated version from 1.0.12 to 1.0.12b0 --- PyBugReporter/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyBugReporter/_version.py b/PyBugReporter/_version.py index 9048498..fa84045 100644 --- a/PyBugReporter/_version.py +++ b/PyBugReporter/_version.py @@ -1 +1 @@ -__version__ = '1.0.12' \ No newline at end of file +__version__ = '1.0.12b0' \ No newline at end of file From 4637ff623d8c98f22bb36a4dd548754d411deb31 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 15 Jun 2026 18:57:14 +0000 Subject: [PATCH 2/9] Auto-updated version from 1.0.12b0 to 1.0.12b0.dev0 --- PyBugReporter/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyBugReporter/_version.py b/PyBugReporter/_version.py index fa84045..ccffd71 100644 --- a/PyBugReporter/_version.py +++ b/PyBugReporter/_version.py @@ -1 +1 @@ -__version__ = '1.0.12b0' \ No newline at end of file +__version__ = '1.0.12b0.dev0' \ No newline at end of file From c83e8846933d7cebe832e96b091018e30d9795a9 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 15 Jun 2026 18:57:32 +0000 Subject: [PATCH 3/9] Auto-updated version from 1.0.12b0 to 1.0.12b1 --- PyBugReporter/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyBugReporter/_version.py b/PyBugReporter/_version.py index fa84045..f4a6059 100644 --- a/PyBugReporter/_version.py +++ b/PyBugReporter/_version.py @@ -1 +1 @@ -__version__ = '1.0.12b0' \ No newline at end of file +__version__ = '1.0.12b1' \ No newline at end of file From bc66952bbeef68393efc1f2ca8844d6ff2e81185 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 15 Jun 2026 18:57:35 +0000 Subject: [PATCH 4/9] Auto-updated version from 1.0.12b1 to 1.0.12b1.dev0 --- PyBugReporter/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyBugReporter/_version.py b/PyBugReporter/_version.py index f4a6059..67fe03a 100644 --- a/PyBugReporter/_version.py +++ b/PyBugReporter/_version.py @@ -1 +1 @@ -__version__ = '1.0.12b1' \ No newline at end of file +__version__ = '1.0.12b1.dev0' \ No newline at end of file From 1eddc0bc86755f60c4544ad6dd764303c477a497 Mon Sep 17 00:00:00 2001 From: BlazeDrake Date: Tue, 14 Jul 2026 14:31:50 -0600 Subject: [PATCH 5/9] Updated wrapper Updated the wrapper function --- PyBugReporter/src/BugReporter.py | 47 ++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/PyBugReporter/src/BugReporter.py b/PyBugReporter/src/BugReporter.py index 231dbe1..5e0fad6 100644 --- a/PyBugReporter/src/BugReporter.py +++ b/PyBugReporter/src/BugReporter.py @@ -1,4 +1,5 @@ import asyncio +import inspect import sys import traceback from functools import wraps @@ -93,20 +94,38 @@ def __call__(self, func: callable) -> None: Args: func (callable): the function to be decorated """ - @wraps(func) - def wrapper(*args, **kwargs) -> None: - """Wrapper function that catches exceptions and sends a bug report to the github repository. - - Args: - *args: the arguments for the function - **kwargs: the keyword arguments for the function - """ - repoName = self.repoName - try: - return func(*args, **kwargs) - except Exception as e: - self._handleError(e, repoName, *args, **kwargs) - return wrapper + if inspect.iscoroutinefunction(func): + @wraps(func) + async def async_wrapper(*args, **kwargs) -> None: + """Wrapper function that catches exceptions and sends a bug report to the github repository. + Works for async functions. + + Args: + *args: the arguments for the function + **kwargs: the keyword arguments for the function + """ + repoName = self.repoName + try: + return func(*args, **kwargs) + except Exception as e: + self._handleError(e, repoName, *args, **kwargs) + return async_wrapper + else: + @wraps(func) + def sync_wrapper(*args, **kwargs) -> None: + """Wrapper function that catches exceptions and sends a bug report to the github repository. + Works for synchronous functions. + + Args: + *args: the arguments for the function + **kwargs: the keyword arguments for the function + """ + repoName = self.repoName + try: + return func(*args, **kwargs) + except Exception as e: + self._handleError(e, repoName, *args, **kwargs) + return sync_wrapper def _handleError(self, e: Exception, repoName: str, *args, **kwargs) -> None: """Handles error by creating a bug report. From 0bfdfac979dc1bcbad886b920bd3a185187a55c2 Mon Sep 17 00:00:00 2001 From: BlazeDrake Date: Tue, 14 Jul 2026 14:33:51 -0600 Subject: [PATCH 6/9] made async function --- PyBugReporter/src/BugReporter.py | 43 ++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/PyBugReporter/src/BugReporter.py b/PyBugReporter/src/BugReporter.py index 5e0fad6..dbb5b7a 100644 --- a/PyBugReporter/src/BugReporter.py +++ b/PyBugReporter/src/BugReporter.py @@ -108,7 +108,7 @@ async def async_wrapper(*args, **kwargs) -> None: try: return func(*args, **kwargs) except Exception as e: - self._handleError(e, repoName, *args, **kwargs) + await self._handleError_async(e, repoName, *args, **kwargs) return async_wrapper else: @wraps(func) @@ -136,6 +136,37 @@ def _handleError(self, e: Exception, repoName: str, *args, **kwargs) -> None: Raises: e: the exception that was raised """ + title, description, shortDescription = self._prepare_bug_report(e, repoName, args, kwargs) + + # Check if we need to send a bug report + if not self.handlers[repoName].test: + self._sendBugReport(repoName, title, description, shortDescription) + + print(title) + print(description) + raise e + + async def _handleError_async(self, e: Exception, repoName: str, *args, **kwargs) -> None: + """Handles error by creating a bug report. + + Args: + e (Exception): the exception that was raised + + Raises: + e: the exception that was raised + """ + title, description, shortDescription = self._prepare_bug_report(e, repoName, args, kwargs) + + # Check if we need to send a bug report + if not self.handlers[repoName].test: + await self._sendBugReport_async(repoName, title, description, shortDescription) + + print(title) + print(description) + raise e + + + def _prepare_bug_report(self, e, repoName, args, kwargs): excType = type(e).__name__ tb = traceback.extract_tb(sys.exc_info()[2]) functionName = tb[-1][2] @@ -163,15 +194,7 @@ def _handleError(self, e: Exception, repoName: str, *args, **kwargs) -> None: shortDescription = f"{start}{compress[:2000 - staticLength]}{end}" print(f"SHORT DESCRIPTION with length {len(shortDescription)}:\n{shortDescription}") - - - # Check if we need to send a bug report - if not self.handlers[repoName].test: - self._sendBugReport(repoName, title, description, shortDescription) - - print(title) - print(description) - raise e + return title,description,shortDescription def _sendBugReport(self, repoName: str, errorTitle: str, errorMessage: str, shortErrorMessage: str) -> None: """Sends a bug report to the Github repository. From ec5969ca1927165238aab0c87f24f52c2e61a05e Mon Sep 17 00:00:00 2001 From: BlazeDrake Date: Tue, 14 Jul 2026 14:40:31 -0600 Subject: [PATCH 7/9] fixed standards --- PyBugReporter/src/BugReporter.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/PyBugReporter/src/BugReporter.py b/PyBugReporter/src/BugReporter.py index dbb5b7a..2fa5391 100644 --- a/PyBugReporter/src/BugReporter.py +++ b/PyBugReporter/src/BugReporter.py @@ -96,7 +96,7 @@ def __call__(self, func: callable) -> None: """ if inspect.iscoroutinefunction(func): @wraps(func) - async def async_wrapper(*args, **kwargs) -> None: + async def wrapper_async(*args, **kwargs) -> None: """Wrapper function that catches exceptions and sends a bug report to the github repository. Works for async functions. @@ -109,10 +109,10 @@ async def async_wrapper(*args, **kwargs) -> None: return func(*args, **kwargs) except Exception as e: await self._handleError_async(e, repoName, *args, **kwargs) - return async_wrapper + return wrapper_async else: @wraps(func) - def sync_wrapper(*args, **kwargs) -> None: + def wrapper(*args, **kwargs) -> None: """Wrapper function that catches exceptions and sends a bug report to the github repository. Works for synchronous functions. @@ -125,7 +125,7 @@ def sync_wrapper(*args, **kwargs) -> None: return func(*args, **kwargs) except Exception as e: self._handleError(e, repoName, *args, **kwargs) - return sync_wrapper + return wrapper def _handleError(self, e: Exception, repoName: str, *args, **kwargs) -> None: """Handles error by creating a bug report. @@ -147,7 +147,7 @@ def _handleError(self, e: Exception, repoName: str, *args, **kwargs) -> None: raise e async def _handleError_async(self, e: Exception, repoName: str, *args, **kwargs) -> None: - """Handles error by creating a bug report. + """Handles error by creating a bug report asynchronously. Args: e (Exception): the exception that was raised @@ -166,7 +166,16 @@ async def _handleError_async(self, e: Exception, repoName: str, *args, **kwargs) raise e - def _prepare_bug_report(self, e, repoName, args, kwargs): + def _prepare_bug_report(self, e: Exception, repoName: str, *args, **kwargs) -> tuple[str,str,str]: + """Prepares all information needed to send the bug report. + + Args: + e (Exception): the exception that was raised + + Returns: + tuple[str,str,str]: The title, description, and short description of the error for the report. + + """ excType = type(e).__name__ tb = traceback.extract_tb(sys.exc_info()[2]) functionName = tb[-1][2] From 4068b857611dc3d4cd6769148a4ffd8b34d84496 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 14 Jul 2026 20:47:27 +0000 Subject: [PATCH 8/9] Auto-updated version from 1.0.12b1.dev0 to 1.0.12b1.dev1 --- PyBugReporter/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyBugReporter/_version.py b/PyBugReporter/_version.py index 67fe03a..a565920 100644 --- a/PyBugReporter/_version.py +++ b/PyBugReporter/_version.py @@ -1 +1 @@ -__version__ = '1.0.12b1.dev0' \ No newline at end of file +__version__ = '1.0.12b1.dev1' \ No newline at end of file From b95b5ca19c4452a01d4b743b15ac98673c675632 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 14 Jul 2026 21:16:08 +0000 Subject: [PATCH 9/9] Auto-updated version from 1.0.12b1.dev1 to 1.0.12b2 --- PyBugReporter/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyBugReporter/_version.py b/PyBugReporter/_version.py index a565920..b07c79f 100644 --- a/PyBugReporter/_version.py +++ b/PyBugReporter/_version.py @@ -1 +1 @@ -__version__ = '1.0.12b1.dev1' \ No newline at end of file +__version__ = '1.0.12b2' \ No newline at end of file