Skip to content

Commit 774ec0c

Browse files
committed
fix: replace 3 remaining silent except:pass with debug logging
- kev.py: cache read failure now logged - owasp_tools.py: glossary FTS search + publication FTS search failures now logged - 5 rounds of verification: all clean. 270/270 tests pass.
1 parent 202e990 commit 774ec0c

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/security_framework_mcp/kev.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ async def _ensure_catalog(self) -> dict:
2929
self._catalog = json.loads(self._cache_path.read_text())
3030
self._last_load = now
3131
return self._catalog
32-
except (json.JSONDecodeError, OSError):
33-
pass
32+
except (json.JSONDecodeError, OSError) as exc:
33+
log.debug("KEV cache read failed, will re-fetch: %s", exc)
3434

3535
try:
3636
async with httpx.AsyncClient(follow_redirects=True) as client:

src/security_framework_mcp/tools/owasp_tools.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,8 +1156,8 @@ async def get_nist_glossary(
11561156
for row in results:
11571157
lines.append(f"### {row['term']}\n{row['definition']}\n_Source: {row.get('source', 'N/A')}_\n")
11581158
return "\n".join(lines)
1159-
except Exception:
1160-
pass
1159+
except Exception as exc:
1160+
log.debug("Glossary FTS search failed: %s", exc)
11611161
return f"Term '{term}' not found. Use get_nist_glossary() to list all terms."
11621162

11631163
return f"# {record['term']}\n\n{record['definition']}\n\n_Source: {record.get('source', 'N/A')}_"
@@ -1182,8 +1182,8 @@ async def get_nist_publication(
11821182
for r in results:
11831183
lines.append(f"- **{r['id']}** — {r['title']}")
11841184
return "\n".join(lines)
1185-
except Exception:
1186-
pass
1185+
except Exception as exc:
1186+
log.debug("Publication FTS search failed: %s", exc)
11871187
return f"Publication '{id}' not found."
11881188
lines = [
11891189
f"# {record['id']}{record['title']}",

0 commit comments

Comments
 (0)