If a non-existing SID snapshot timestamp is provided (meaning that it's older than all the known timestamps) return a 400 bad request instead of throwing an exception and returning a 500 error. This way dapla-toolbelt-pseudo can report a meaningful error message to users.
See src/main/java/no/ssb/dlp/pseudo/service/sid/SidMapper.java:
if (availableSnapshotDates.stream().allMatch(requestedSnapshotDate::isBefore)) {
throw new InvalidSidSnapshotDateException(
String.format("Requested date is of an earlier date than all available SID dates. Valid dates are: %s",
String.join(", ", availableSnapshots.items())));
}
If a non-existing SID snapshot timestamp is provided (meaning that it's older than all the known timestamps) return a 400 bad request instead of throwing an exception and returning a 500 error. This way
dapla-toolbelt-pseudocan report a meaningful error message to users.See
src/main/java/no/ssb/dlp/pseudo/service/sid/SidMapper.java: