Skip to content

Commit 8435c9a

Browse files
Copilotp-
andauthored
Narrow exception suppression to OperationalError only
Address code review feedback: catch only sqlalchemy.exc.OperationalError instead of all exceptions, so legitimate errors (permissions, disk space) are not silently swallowed. Agent-Logs-Url: https://github.com/GitHubSecurityLab/seclab-taskflows/sessions/84c7962f-5966-4924-8617-8378affd1621 Co-authored-by: p- <176818+p-@users.noreply.github.com>
1 parent 153a0a7 commit 8435c9a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/seclab_taskflows/mcp_servers/gh_file_viewer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import contextlib
1111
from sqlalchemy.orm import DeclarativeBase, mapped_column, Mapped
1212
from sqlalchemy import create_engine
13+
from sqlalchemy.exc import OperationalError
1314
from sqlalchemy.orm import Session
1415
from typing import Optional
1516
from pathlib import Path
@@ -54,7 +55,7 @@ def __repr__(self):
5455
SEARCH_RESULT_DIR = mcp_data_dir("seclab-taskflows", "gh_file_viewer", "SEARCH_RESULTS_DIR")
5556

5657
engine = create_engine(f"sqlite:///{os.path.abspath(SEARCH_RESULT_DIR)}/search_result.db", echo=False)
57-
with contextlib.suppress(Exception):
58+
with contextlib.suppress(OperationalError):
5859
Base.metadata.create_all(engine, tables=[SearchResults.__table__])
5960

6061

0 commit comments

Comments
 (0)