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:
@@ -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}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user