From 85e5951799869074b43714ef02aa0c972c9b15cb Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Thu, 10 Jul 2025 14:52:57 +0100 Subject: Fix mistakes from my inferior brain (#327) * Rename GitHubException in cog * Update GitHubException in Teams API * Update __init__.py in GitHub API with new exception naming --- arthur/apis/github/teams.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'arthur/apis/github/teams.py') diff --git a/arthur/apis/github/teams.py b/arthur/apis/github/teams.py index 5fcc3a0..489da90 100644 --- a/arthur/apis/github/teams.py +++ b/arthur/apis/github/teams.py @@ -13,7 +13,7 @@ HTTP_403 = 403 HTTP_422 = 422 -class GitHubException(Exception): +class GitHubError(Exception): """Custom exception for GitHub API errors.""" def __init__(self, message: str): @@ -31,13 +31,13 @@ async def add_staff_member(username: str) -> None: except aiohttp.ClientResponseError as e: if e.status == HTTP_404: msg = f"Team or user not found: {e.message}" - raise GitHubException(msg) + raise GitHubError(msg) if e.status == HTTP_403: msg = f"Forbidden: {e.message}" - raise GitHubException(msg) + raise GitHubError(msg) if e.status == HTTP_422: msg = "Cannot add organisation as a team member" - raise GitHubException(msg) + raise GitHubError(msg) msg = f"Unexpected error: {e.message}" - raise GitHubException(msg) + raise GitHubError(msg) -- cgit v1.2.3