Skip to content

Commit

Permalink
Merge pull request #1152 from anto-ac/show-exception-message-when-fal…
Browse files Browse the repository at this point in the history
…ling-back

chore: improve logging when falling back to DateUtils.parseDate
  • Loading branch information
Ronald Holshausen authored Jul 3, 2020
2 parents aa3608f + c5d4e01 commit eb4747d
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,10 @@ fun <M : Mismatch> matchDateTime(
} catch (e: DateTimeParseException) {
try {
logger.warn {
"""Unable to parse ${valueOf(actual)} with $pattern using java.time.format.DateTimeFormatter.
Attempting to parse using org.apache.commons.lang3.time.DateUtils
to guarantee backwards compatibility with versions < 4.1.1.
"""Failed to parse ${valueOf(actual)} with '$pattern' using java.time.format.DateTimeFormatter.
Exception was: ${e.message}.
Will attempt to parse using org.apache.commons.lang3.time.DateUtils to guarantee backwards
compatibility with versions < 4.1.1.
Please update your patterns in your pact tests as this may not be supported in future versions."""
}
DateUtils.parseDate(safeToString(actual), pattern)
Expand Down

0 comments on commit eb4747d

Please sign in to comment.