Skip to content

Commit 7bbfe43

Browse files
committed
review: silence BLE001 on the two CodeRabbit-cited best-effort catches
api/workspaces.py:876 (per-CLI-session traverse_blobs catch) and api/workspaces.py:1398 (per-composer-row tabs parse catch) are intentionally broad — a single malformed session or composer must not 500 the whole endpoint, and `exc_info=True` on the .warning() call already captures the concrete exception type for debugging. Added `# noqa: BLE001` with a one-line rationale on each line so the intent survives future readers. CodeRabbit's review on PR #35 cited exactly these two sites; the other BLE001 hits in the file are pre-existing and out of scope for issue #29 ("polish only, no logic changes"). Verified: full suite still 178/178; ruff default rule set still clean.
1 parent 5f1907e commit 7bbfe43

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

api/workspaces.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ def _get_cli_workspace_tabs(workspace_id: str):
873873

874874
try:
875875
messages = traverse_blobs(session["db_path"])
876-
except Exception:
876+
except Exception: # noqa: BLE001 — best-effort per-session skip; one corrupted session must not 500 the endpoint, and the failure mode is logged with exc_info so the concrete type is preserved.
877877
_logger.warning("CLI: could not read session %s", session_id, exc_info=True)
878878
continue
879879

@@ -1395,7 +1395,7 @@ def get_workspace_tabs(workspace_id):
13951395

13961396
response["tabs"].append(tab)
13971397

1398-
except Exception:
1398+
except Exception: # noqa: BLE001 — best-effort per-composer skip in a read-many loop; one malformed row must not 500 the tabs endpoint, and exc_info captures the concrete type for debugging.
13991399
_logger.warning("Error parsing composer data for %s", composer_id, exc_info=True)
14001400

14011401
# Sort tabs by timestamp descending (newest first)

0 commit comments

Comments
 (0)