fix: replace 59 bare except clauses with proper logging (#25)

All `except Exception:` now catch as `except Exception as exc:` with
appropriate logging (warning for critical paths, debug for graceful degradation).

Added logger setup to 4 files that lacked it:
- src/timmy/memory/vector_store.py
- src/dashboard/middleware/csrf.py
- src/dashboard/middleware/security_headers.py
- src/spark/memory.py

31 files changed across timmy core, dashboard, infrastructure, integrations.
Zero bare excepts remain. 1340 tests passing.
This commit is contained in:
2026-03-14 19:07:14 -04:00
parent b01c1cb582
commit fdc5b861ca
31 changed files with 131 additions and 70 deletions

View File

@@ -87,7 +87,8 @@ def _get_git_context() -> dict:
).stdout.strip()
return {"branch": branch, "commit": commit}
except Exception:
except Exception as exc:
logger.warning("Git info capture error: %s", exc)
return {"branch": "unknown", "commit": "unknown"}
@@ -199,7 +200,8 @@ def capture_error(
"title": title[:100],
},
)
except Exception:
except Exception as exc:
logger.warning("Bug report screenshot error: %s", exc)
pass
except Exception as task_exc:
@@ -214,7 +216,8 @@ def capture_error(
message=f"{type(exc).__name__} in {source}: {str(exc)[:80]}",
category="system",
)
except Exception:
except Exception as exc:
logger.warning("Bug report notification error: %s", exc)
pass
# 4. Record in session logger
@@ -226,7 +229,8 @@ def capture_error(
error=f"{type(exc).__name__}: {str(exc)}",
context=source,
)
except Exception:
except Exception as exc:
logger.warning("Bug report session logging error: %s", exc)
pass
return task_id