Skip to content

Commit

Permalink
Throw exception on unreachable branches
Browse files Browse the repository at this point in the history
Signed-off-by: yuxiqian <[email protected]>
  • Loading branch information
yuxiqian committed Oct 12, 2024
1 parent f1bdd14 commit ed28d6c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,9 @@ private static TimestampData castToTimestamp(Object object, String timezone) {
LocalDateTime.ofInstant(
((ZonedTimestampData) object).toInstant(), ZoneId.of(timezone)));
} else {
return TimestampData.fromLocalDateTime(LocalDateTime.parse(String.valueOf(object)));
throw new IllegalArgumentException(
String.format(
"Unable to implicitly coerce object `%s` as a TIMESTAMP.", object));
}
}
}

0 comments on commit ed28d6c

Please sign in to comment.