Fix 62 bare except clauses across the codebase #25

Closed
opened 2026-03-14 13:33:34 +00:00 by Rockachopa · 0 comments
Owner

What

62 bare except Exception: or except: clauses across 33 files. These silently swallow errors, making debugging nearly impossible.

Worst offenders:

  • timmy/tools.py — 7 bare excepts
  • timmy/tools_intro/__init__.py — 5
  • timmy/thinking.py — 5
  • infrastructure/error_capture.py — 4 (ironic)
  • integrations/chat_bridge/vendors/discord.py — 4
  • infrastructure/ws_manager/handler.py — 3

Why

"Graceful degradation" is the stated pattern, but silently swallowing exceptions means you never know what's failing. On a local system where you own the logs, you should at minimum logger.debug() every caught exception.

What to do

  1. Find all bare excepts: grep -rn "except Exception:$\|except:$" src/
  2. For each one, add at minimum logger.debug("context: %s", exc)
  3. For critical paths (agent creation, tool execution), upgrade to logger.warning()
  4. Never bare except: — always except Exception as exc:

Estimated effort: 1 hour (mechanical find-and-replace)

## What 62 bare `except Exception:` or `except:` clauses across 33 files. These silently swallow errors, making debugging nearly impossible. ### Worst offenders: - `timmy/tools.py` — 7 bare excepts - `timmy/tools_intro/__init__.py` — 5 - `timmy/thinking.py` — 5 - `infrastructure/error_capture.py` — 4 (ironic) - `integrations/chat_bridge/vendors/discord.py` — 4 - `infrastructure/ws_manager/handler.py` — 3 ## Why "Graceful degradation" is the stated pattern, but silently swallowing exceptions means you never know what's failing. On a local system where you own the logs, you should at minimum `logger.debug()` every caught exception. ## What to do 1. Find all bare excepts: `grep -rn "except Exception:$\|except:$" src/` 2. For each one, add at minimum `logger.debug("context: %s", exc)` 3. For critical paths (agent creation, tool execution), upgrade to `logger.warning()` 4. Never bare `except:` — always `except Exception as exc:` ## Estimated effort: 1 hour (mechanical find-and-replace)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#25