TheJacksonLaboratory / LIRICAL

LIkelihood Ratio Interpretation of Clinical AbnormaLities
https://thejacksonlaboratory.github.io/LIRICAL/stable
Other
22 stars 11 forks source link

Unhelpful error message when exomiser data directory isn't set #457

Closed justaddcoffee closed 4 years ago

justaddcoffee commented 4 years ago

For example, using the command (incorrectly, without the -e flag): java -jar target/LIRICAL.jar phenopacket -p simple_config.txt we get a NullPointerException. Probably should instead emit message about not being able to find exomiser data.

Here's the config file used in the command above.

~/IdeaProjects/LIRICAL *develop $ java -jar target/LIRICAL.jar phenopacket -p simple_config.txt 
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/jtr4v/IdeaProjects/LIRICAL/target/LIRICAL.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/jtr4v/IdeaProjects/LIRICAL/target/lib/log4j-slf4j-impl-2.12.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
Exception in thread "main" java.lang.NullPointerException
    at java.base/java.io.File.<init>(File.java:276)
    at org.monarchinitiative.lirical.configuration.LiricalFactory.qcExomiserFiles(LiricalFactory.java:504)
    at org.monarchinitiative.lirical.cmd.PhenopacketCommand.runVcfAnalysis(PhenopacketCommand.java:87)
    at org.monarchinitiative.lirical.cmd.PhenopacketCommand.run(PhenopacketCommand.java:202)
    at org.monarchinitiative.lirical.Lirical.main(Lirical.java:149)
~/IdeaProjects/LIRICAL *develop $ 
pnrobinson commented 4 years ago

We should emit an error message and die on a runtime exception?

justaddcoffee commented 4 years ago

Perhaps poorly phrased on my part - we should die with an error message about the user not setting the exomiser data directory, probably while the command line options are being parsed (instead of waiting to die later with a NullPointerException)