feat: add a bare except to catch all errors

This commit is contained in:
Alessio
2025-06-21 15:31:21 +03:00
parent d00cbd4da7
commit bc99cf83dd

View File

@ -51,7 +51,7 @@ class PRAgent:
def __init__(self, ai_handler: partial[BaseAiHandler,] = LiteLLMAIHandler): def __init__(self, ai_handler: partial[BaseAiHandler,] = LiteLLMAIHandler):
self.ai_handler = ai_handler # will be initialized in run_action self.ai_handler = ai_handler # will be initialized in run_action
async def handle_request(self, pr_url, request, notify=None) -> bool: async def _handle_request(self, pr_url, request, notify=None) -> bool:
# First, apply repo specific settings if exists # First, apply repo specific settings if exists
apply_repo_settings(pr_url) apply_repo_settings(pr_url)
@ -117,3 +117,10 @@ class PRAgent:
else: else:
return False return False
return True return True
async def handle_request(self, pr_url, request, notify=None) -> bool:
try:
return await self._handle_request(pr_url, request, notify)
except:
get_logger().exception("Failed to process the command.")
return False