From dfeecf4fb93ef864af93e70cd769e648541999f2 Mon Sep 17 00:00:00 2001 From: Zamil Majdy Date: Sat, 26 Oct 2024 16:34:35 +0700 Subject: [PATCH] Propagate clean error message from github error to user --- .../backend/backend/integrations/webhooks/github.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/autogpt_platform/backend/backend/integrations/webhooks/github.py b/autogpt_platform/backend/backend/integrations/webhooks/github.py index 0c69368e452d..938a5998e71c 100644 --- a/autogpt_platform/backend/backend/integrations/webhooks/github.py +++ b/autogpt_platform/backend/backend/integrations/webhooks/github.py @@ -127,6 +127,8 @@ async def _register_webhook( if response.status_code != 201: error_msg = extract_github_error_msg(response) + if "not found" in error_msg.lower(): + error_msg = f"{error_msg} (Make sure the GitHub account has an add webhook permission to the repository)" raise ValueError(f"Failed to create GitHub webhook: {error_msg}") webhook_id = response.json()["id"]