mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-01 19:30:40 +08:00
Merge pull request #1884 from alessio-locatelli/handle_500_Internal_Server_Error
feat: wrap the command's entry point to catch all errors
This commit is contained in:
@ -51,7 +51,7 @@ class PRAgent:
|
||||
def __init__(self, ai_handler: partial[BaseAiHandler,] = LiteLLMAIHandler):
|
||||
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
|
||||
apply_repo_settings(pr_url)
|
||||
|
||||
@ -117,3 +117,10 @@ class PRAgent:
|
||||
else:
|
||||
return False
|
||||
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
|
||||
|
Reference in New Issue
Block a user