-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create src/errors.rs
with generic errors for the entire crate
#215
Comments
While this change happens, we could also think about moving the Lines 19 to 32 in 29565f9
|
As discussed, I started working on this. First draft is available in landesfeind/rust-htslib:215_generic_errors_for_entire_crate While there are clearly some generic errors, others are also quite specific to the modules. I am wondering if there is a preference in using specialized errors with a prefix (i.e., what I did in a first merge to solve name-conflicts) like Any thoughts? |
In PR #165 (now superseded by PR #214 ), the review led to the idea of defining generic errors like
FileNotFound
andNonUnicodePath
on the highest level of the crate, i.e. in a new filesrc/errors.rs
. This avoids redundantly defining such errors for all submodules. Currently, the two example errors are defined both forbam
,tbx
andfaidx
:rust-htslib/src/bam/errors.rs
Lines 21 to 24 in 61b0644
rust-htslib/src/tbx/errors.rs
Lines 15 to 18 in 61b0644
rust-htslib/src/faidx/errors.rs
Lines 9 to 12 in 29565f9
And
NonUnicodePath
is also defined forbcf
, butFileNotFound
is missing there. So such high-level definition could also help clean up the errors a bit:rust-htslib/src/bcf/errors.rs
Lines 40 to 41 in 61b0644
The text was updated successfully, but these errors were encountered: