Index.writeBasedOnFeaturePath should throw instead of silently Failing #841
Merged
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
558f52f
Throw instead of silently failing for Index.writeBasedOnFeaturePath
magicDGS 647b21d
Remove unused logger
magicDGS b7e1495
Update javadoc
magicDGS 06074a5
Add test to exercise the new behaviour
magicDGS 9ca3846
Fix import
magicDGS
Jump to file or symbol
Failed to load files and symbols.
| @@ -66,8 +66,6 @@ | ||
| MAGIC_NUMBER = bb.order(ByteOrder.LITTLE_ENDIAN).getInt(); | ||
| } | ||
| - private static final Log LOGGER = Log.getInstance(TabixIndex.class); | ||
| - | ||
| private final TabixFormat formatSpec; | ||
| private final List<String> sequenceNames; | ||
| private final BinningIndexContent[] indices; | ||
| @@ -226,12 +224,12 @@ public void write(final Path tabixPath) throws IOException { | ||
| * Writes to a path with appropriate name and directory based on feature path. | ||
| * | ||
| * @param featurePath Path being indexed. | ||
| + * @throws IOException if featureFile is not a normal file. | ||
| */ | ||
| @Override | ||
| public void writeBasedOnFeaturePath(final Path featurePath) throws IOException { | ||
|
|
||
| if (!Files.isRegularFile(featurePath)) { | ||
| - LOGGER.warn("Index not written into ", featurePath); | ||
| - return; | ||
| + throw new IOException("Cannot write based on a non-regular file: " + featurePath.toUri()); | ||
droazen
Contributor
|
||
| } | ||
| write(Tribble.tabixIndexPath(featurePath)); | ||
| } | ||
Can you update the javadoc for this method (and overloads) in the
Indexinterface to mention that this method now throws anIOExceptionin the case wherefeaturePathis not a regular file?