Skip to content

Commit 404ba4d

Browse files
Potential fix for pull request finding 'Empty except'
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
1 parent 019c263 commit 404ba4d

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/specify_cli/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,8 +1029,13 @@ def init(
10291029
# Config was written despite the failed install;
10301030
# the Python context-section plumbing remains active.
10311031
_ac_err_msg += "; config written, Python context plumbing active"
1032-
except Exception:
1033-
pass
1032+
except Exception as cfg_err:
1033+
sanitized_cfg = str(cfg_err).replace('\n', ' ').strip()
1034+
cfg_msg = f"config update failed: {sanitized_cfg[:120]}"
1035+
if _ac_err_msg is not None:
1036+
_ac_err_msg += f"; {cfg_msg}"
1037+
else:
1038+
_ac_err_msg = cfg_msg
10341039
if _ac_err_msg is not None:
10351040
tracker.error("agent-context", _ac_err_msg)
10361041

0 commit comments

Comments
 (0)