Merge pull request #3938 from koriyoshi2041/fix/replace-bare-except-handlers

fix: replace bare except handlers with specific exception types
This commit is contained in:
Mark Backman
2026-03-08 09:04:49 -04:00
committed by GitHub
7 changed files with 7 additions and 10 deletions

View File

@@ -70,7 +70,7 @@ class UrlToImageProcessor(FrameProcessor):
return data["artObject"]["webImage"]["url"]
if "artworks" in data and len(data["artworks"]):
return data["artworks"][0]["webImage"]["url"]
except:
except (json.JSONDecodeError, KeyError, TypeError):
pass
return None

View File

@@ -72,7 +72,7 @@ class UrlToImageProcessor(FrameProcessor):
return data["artObject"]["webImage"]["url"]
if "artworks" in data and len(data["artworks"]):
return data["artworks"][0]["webImage"]["url"]
except:
except (json.JSONDecodeError, KeyError, TypeError):
pass
async def run_image_process(self, image_url: str):