Skip to content

Commit

Permalink
(#2991) Do not log DateTimeParseExceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
squaregoldfish committed Oct 29, 2024
1 parent 9fd0116 commit 594ed5b
Showing 1 changed file with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import uk.ac.exeter.QuinCe.data.Files.DataFile;
import uk.ac.exeter.QuinCe.data.Files.DataFileException;
import uk.ac.exeter.QuinCe.data.Files.ValueNotNumericException;
import uk.ac.exeter.QuinCe.utils.ExceptionUtils;

/**
* Defines how the date and time are stored in a data file
Expand Down Expand Up @@ -873,7 +872,6 @@ private LocalDateTime getHoursFromStartDate(LocalDateTime headerDate,
try {
result = headerDate.plusSeconds(lineSeconds);
} catch (DateTimeException e) {
ExceptionUtils.printStackTrace(e);
throw new DateTimeSpecificationException(
"Invalid hours value: " + e.getMessage());
}
Expand Down Expand Up @@ -913,7 +911,6 @@ private LocalDateTime getSecondsFromStartDate(LocalDateTime headerDate,
try {
result = headerDate.plusSeconds(Math.round(seconds));
} catch (DateTimeException e) {
ExceptionUtils.printStackTrace(e);
throw new DateTimeSpecificationException(
"Invalid hours value: " + e.getMessage());
}
Expand Down Expand Up @@ -944,7 +941,6 @@ private LocalDateTime getDateTime(List<String> line)
try {
result = LocalDateTime.parse(fieldValue, assignment.getFormatter());
} catch (DateTimeParseException e) {
ExceptionUtils.printStackTrace(e);
throw new DateTimeSpecificationException(
"Invalid date/time value '" + fieldValue + "'");
}
Expand Down Expand Up @@ -977,7 +973,6 @@ private LocalDateTime getUnixTime(List<String> line)
result = LocalDateTime.ofEpochSecond(Integer.parseInt(fieldValue), 0,
ZoneOffset.UTC);
} catch (DateTimeParseException e) {
ExceptionUtils.printStackTrace(e);
throw new DateTimeSpecificationException(
"Invalid date/time value '" + fieldValue + "'");
}
Expand Down Expand Up @@ -1034,7 +1029,6 @@ private LocalDateTime getYearJDayTime(List<String> line)
double secondsFraction = jdayTime - jdayTime.intValue();
result = result.plusSeconds((int) (secondsFraction * 86400));
} catch (DateTimeException e) {
ExceptionUtils.printStackTrace(e);
throw new DateTimeSpecificationException(
"Invalid date/time value: " + e.getMessage());
}
Expand Down Expand Up @@ -1118,7 +1112,6 @@ private LocalDate getYearJDay(List<String> line)
try {
result = LocalDate.ofYearDay(year, jday);
} catch (DateTimeException e) {
ExceptionUtils.printStackTrace(e);
throw new DateTimeSpecificationException(
"Invalid date/time: " + e.getMessage());
}
Expand Down Expand Up @@ -1176,7 +1169,6 @@ private LocalDate getYMDDate(List<String> line)
try {
result = LocalDate.of(year, month, day);
} catch (DateTimeException e) {
ExceptionUtils.printStackTrace(e);
throw new DateTimeSpecificationException(
"Invalid date value: " + e.getMessage());
}
Expand Down Expand Up @@ -1259,7 +1251,6 @@ private LocalTime getHMSTime(List<String> line)
try {
result = LocalTime.of(hour, minute, second);
} catch (DateTimeException e) {
ExceptionUtils.printStackTrace(e);
throw new DateTimeSpecificationException(
"Invalid time value: " + e.getMessage());
}
Expand Down

0 comments on commit 594ed5b

Please sign in to comment.