Skip to content

Commit

Permalink
Propagate clean error message from github error to user
Browse files Browse the repository at this point in the history
  • Loading branch information
majdyz committed Oct 26, 2024
1 parent 90d1fc7 commit dfeecf4
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit dfeecf4

Please sign in to comment.