Skip to content

Improve error handling in _parse_metadata_paths#1178

Open
vshnvii wants to merge 1 commit intomalariagen:masterfrom
vshnvii:improve-metadata-error-handling
Open

Improve error handling in _parse_metadata_paths#1178
vshnvii wants to merge 1 commit intomalariagen:masterfrom
vshnvii:improve-metadata-error-handling

Conversation

@vshnvii
Copy link

@vshnvii vshnvii commented Mar 21, 2026

Summary

This PR improves error handling in _parse_metadata_paths by providing clearer and more informative error messages when metadata loading fails.

Motivation

While exploring the code, I noticed that exceptions returned during file loading are passed directly to parsing functions. This can lead to unclear or indirect errors, making debugging harder.

Changes

  • Added explicit handling for exceptions when reading metadata files
  • Raised a RuntimeError with:
    • sample set name
    • file path
    • original error

Example

Instead of a generic failure, users will now see:

Failed to load metadata for sample set 'XYZ' at path '...'. Original error: ...

Notes

This improves debuggability and user experience without changing the existing API behavior.

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