From 55f676da16691c7eb23f1ffcb3b589dc3842b274 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 13 Nov 2025 14:43:26 -0500 Subject: Replace bare exception catches with specific exceptions - Replace Exception with httpx.HTTPError, httpx.TimeoutException, re.error in extract_og_metadata - Replace Exception with ValueError, KeyError in auth verification - Replace Exception with httpx errors and ValueError in submit_article - Replace Exception with ValueError, KeyError, AttributeError in RSS feed generation - Replace Exception with ValueError, KeyError in cancel/retry/delete job handlers Improves error handling specificity and removes BLE001 linter suppressions. Amp-Thread-ID: https://ampcode.com/threads/T-8edacbeb-b343-49ca-b524-1c999272acb6 Co-authored-by: Amp --- Biz/PodcastItLater/Admin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Biz/PodcastItLater/Admin.py') diff --git a/Biz/PodcastItLater/Admin.py b/Biz/PodcastItLater/Admin.py index 4920b39..6892234 100644 --- a/Biz/PodcastItLater/Admin.py +++ b/Biz/PodcastItLater/Admin.py @@ -615,7 +615,7 @@ def retry_queue_item(request: Request, job_id: int) -> Response: status_code=200, headers={"HX-Redirect": "/admin"}, ) - except Exception as e: # noqa: BLE001 + except (ValueError, KeyError) as e: return Response( f"Error retrying job: {e!s}", status_code=500, @@ -643,7 +643,7 @@ def delete_queue_item(request: Request, job_id: int) -> Response: status_code=200, headers={"HX-Redirect": "/admin"}, ) - except Exception as e: # noqa: BLE001 + except (ValueError, KeyError) as e: return Response( f"Error deleting job: {e!s}", status_code=500, -- cgit v1.2.3