Merge pull request #54 from adv3nt3/fix/narrow-exception-handling

fix: narrow bare except Exception to specific types where safe
This commit is contained in:
Ben Sigman
2026-04-07 13:54:05 -07:00
committed by GitHub
5 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -253,7 +253,7 @@ def _wikipedia_lookup(word: str) -> dict:
"note": "not found in Wikipedia — likely a proper noun or unusual name",
}
return {"inferred_type": "unknown", "confidence": 0.0, "wiki_summary": None}
except Exception:
except (urllib.error.URLError, OSError, json.JSONDecodeError, KeyError):
return {"inferred_type": "unknown", "confidence": 0.0, "wiki_summary": None}