Skip to content

Fix issue where providing non-existing SID snapshot results in an internal server error #115

@skykanin

Description

@skykanin

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())));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions