biocodellc / geome-db

MIT License
2 stars 0 forks source link

NumberFormatException allows "Unknown" for month day and year but inputing this gives SRA error #35

Open jdeck88 opened 4 years ago

jdeck88 commented 4 years ago

Downloading SRA data with month or day of "Unknown" gives an error. However, the SRA downloader will give an error:

java.lang.NumberFormatException: For input string: "Unknown"
    at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.base/java.lang.Integer.parseInt(Integer.java:652)
    at java.base/java.lang.Integer.parseInt(Integer.java:770)
    at biocode.fims.geome.sra.GeomeBioSampleMapper.getCollectionDate(GeomeBioSampleMapper.java:242)
    at biocode.fims.geome.sra.GeomeBioSampleMapper.recordToBioSample(GeomeBioSampleMapper.java:171)

This returns a server error to interface. I think we enabled "Unknown" for the Number Format rule for years for cases where this value is not known. I need to research the root of the error when downloading SRA data and see if we should just translate Unknown values to null values (could work) and/or if these values are actually required. In any case, we should only allow "Unknown" as a value for Year since it is a GEOME required field. For projects that actually want to be more explicit in requiring month and day we should not allow unknown values.