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