Skip to content

fix: replace 5 bare excepts with except Exception in bio-research scripts#82

Open
haosenwang1018 wants to merge 1 commit intoanthropics:mainfrom
haosenwang1018:fix/bare-excepts-bio-research
Open

fix: replace 5 bare excepts with except Exception in bio-research scripts#82
haosenwang1018 wants to merge 1 commit intoanthropics:mainfrom
haosenwang1018:fix/bare-excepts-bio-research

Conversation

@haosenwang1018
Copy link

Summary

Replace 5 bare except: clauses with except Exception: in the bio-research nextflow-development scripts.

Why

Bare except: catches KeyboardInterrupt and SystemExit, which can mask real errors and prevent clean process termination. except Exception: preserves the error-suppression behavior while allowing system-level exceptions to propagate.

Changes

  • check_environment.py: 4 sites (memory detection, disk space, Docker Hub check, nf-core check)
  • detect_data_type.py: 1 site (file size calculation)

All changes are minimal and behavior-preserving — only the exception base class changes.

…ipts

Bare `except:` clauses catch `KeyboardInterrupt` and `SystemExit`, which
can mask real errors and make debugging harder. Replace with
`except Exception:` to preserve the intended error-suppression behavior
while allowing system-level exceptions to propagate normally.

Files changed:
- bio-research/skills/nextflow-development/scripts/check_environment.py (4 sites)
- bio-research/skills/nextflow-development/scripts/detect_data_type.py (1 site)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant