| 1 |
package org.broadinstitute.hellbender.utils.bwa; |
| 2 |
|
| 3 |
/** |
| 4 |
* Created by valentin on 7/30/17. |
| 5 |
*/ |
| 6 |
public class CouldNotReadIndexException extends RuntimeException { |
| 7 |
|
| 8 |
private final String index; |
| 9 |
|
| 10 |
public CouldNotReadIndexException(final String index, final String message) { |
| 11 |
super(composeMessage(index, message)); |
| 12 |
this.index = index; |
| 13 |
} |
| 14 |
|
| 15 |
public String getImage() { |
| 16 |
return index; |
| 17 |
} |
| 18 |
|
| 19 |
public CouldNotReadIndexException(final String index) { |
| 20 |
super(composeMessage(index, null)); |
| 21 |
this.index = index; |
| 22 |
} |
| 23 |
|
| 24 |
private static String composeMessage(final String index, final String message) { |
| 25 |
return String.format("could not read index '%s'" + ((message == null) ? "" : ": " + message), index); |
| 26 |
} |
| 27 |
} |