Skip to content

Commit

Permalink
Improve error emssage and raise log level
Browse files Browse the repository at this point in the history
  • Loading branch information
fhennig committed Dec 11, 2024
1 parent f1f5eb4 commit 4cc1856
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ class EarliestReleaseDateFinder(private val fields: List<String>) {
val date = try {
LocalDateTime(LocalDate.parse(dateText), LocalTime.fromSecondOfDay(0))
} catch (e: IllegalArgumentException) {
log.warn {
"Incorrectly formatted date on ${rawProcessedData.accession}." +
"${rawProcessedData.version} on field $field: $dateText"
log.error {
"Unexpected error: Incorrectly formatted date on ${rawProcessedData.accession}." +
"${rawProcessedData.version} on field $field: $dateText " +
"Something is wrong with this instance: it might be a configuration error or a bug of " +
"the software. Please feel free to reach out to the developers if you need advice " +
"(https://github.com/loculus-project/loculus/issues/)."
}
null
}
Expand Down

0 comments on commit 4cc1856

Please sign in to comment.