Skip to content

Commit 594ed5b

Browse files
(#2991) Do not log DateTimeParseExceptions
1 parent 9fd0116 commit 594ed5b

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

WebApp/src/uk/ac/exeter/QuinCe/data/Instrument/DataFormats/DateTimeSpecification.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import uk.ac.exeter.QuinCe.data.Files.DataFile;
1616
import uk.ac.exeter.QuinCe.data.Files.DataFileException;
1717
import uk.ac.exeter.QuinCe.data.Files.ValueNotNumericException;
18-
import uk.ac.exeter.QuinCe.utils.ExceptionUtils;
1918

2019
/**
2120
* Defines how the date and time are stored in a data file
@@ -873,7 +872,6 @@ private LocalDateTime getHoursFromStartDate(LocalDateTime headerDate,
873872
try {
874873
result = headerDate.plusSeconds(lineSeconds);
875874
} catch (DateTimeException e) {
876-
ExceptionUtils.printStackTrace(e);
877875
throw new DateTimeSpecificationException(
878876
"Invalid hours value: " + e.getMessage());
879877
}
@@ -913,7 +911,6 @@ private LocalDateTime getSecondsFromStartDate(LocalDateTime headerDate,
913911
try {
914912
result = headerDate.plusSeconds(Math.round(seconds));
915913
} catch (DateTimeException e) {
916-
ExceptionUtils.printStackTrace(e);
917914
throw new DateTimeSpecificationException(
918915
"Invalid hours value: " + e.getMessage());
919916
}
@@ -944,7 +941,6 @@ private LocalDateTime getDateTime(List<String> line)
944941
try {
945942
result = LocalDateTime.parse(fieldValue, assignment.getFormatter());
946943
} catch (DateTimeParseException e) {
947-
ExceptionUtils.printStackTrace(e);
948944
throw new DateTimeSpecificationException(
949945
"Invalid date/time value '" + fieldValue + "'");
950946
}
@@ -977,7 +973,6 @@ private LocalDateTime getUnixTime(List<String> line)
977973
result = LocalDateTime.ofEpochSecond(Integer.parseInt(fieldValue), 0,
978974
ZoneOffset.UTC);
979975
} catch (DateTimeParseException e) {
980-
ExceptionUtils.printStackTrace(e);
981976
throw new DateTimeSpecificationException(
982977
"Invalid date/time value '" + fieldValue + "'");
983978
}
@@ -1034,7 +1029,6 @@ private LocalDateTime getYearJDayTime(List<String> line)
10341029
double secondsFraction = jdayTime - jdayTime.intValue();
10351030
result = result.plusSeconds((int) (secondsFraction * 86400));
10361031
} catch (DateTimeException e) {
1037-
ExceptionUtils.printStackTrace(e);
10381032
throw new DateTimeSpecificationException(
10391033
"Invalid date/time value: " + e.getMessage());
10401034
}
@@ -1118,7 +1112,6 @@ private LocalDate getYearJDay(List<String> line)
11181112
try {
11191113
result = LocalDate.ofYearDay(year, jday);
11201114
} catch (DateTimeException e) {
1121-
ExceptionUtils.printStackTrace(e);
11221115
throw new DateTimeSpecificationException(
11231116
"Invalid date/time: " + e.getMessage());
11241117
}
@@ -1176,7 +1169,6 @@ private LocalDate getYMDDate(List<String> line)
11761169
try {
11771170
result = LocalDate.of(year, month, day);
11781171
} catch (DateTimeException e) {
1179-
ExceptionUtils.printStackTrace(e);
11801172
throw new DateTimeSpecificationException(
11811173
"Invalid date value: " + e.getMessage());
11821174
}
@@ -1259,7 +1251,6 @@ private LocalTime getHMSTime(List<String> line)
12591251
try {
12601252
result = LocalTime.of(hour, minute, second);
12611253
} catch (DateTimeException e) {
1262-
ExceptionUtils.printStackTrace(e);
12631254
throw new DateTimeSpecificationException(
12641255
"Invalid time value: " + e.getMessage());
12651256
}

0 commit comments

Comments
 (0)