Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug kbss-cvut/termit-ui#511] URI validating on persist or update #300

Merged
merged 3 commits into from
Sep 19, 2024

Conversation

lukaskabc
Copy link
Collaborator

resolves kbss-cvut/termit-ui#511

BaseRepositoryService will now perform additional validation of the URI before each persist and update.

URI is valid when it is null or valid URI according to IdentifierResolver#isUri.

RestExceptionHandler will now provide more detailed information on URISyntaxException.

…d before each persists and updates.

Base repository will validate the identifier (URI) during each pre-persist and pre-update.
InvalidIdentifierException caused by URISyntaxException will now provide error details to the client.
*/
public static boolean isCausedBy(final Throwable throwable, @NonNull final Class<? extends Throwable> cause) {
public static <T extends Throwable> Optional<T> isCausedBy(final Throwable throwable, @NonNull final Class<T> cause) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method name is now quite misleading.

Rename isCausedBy to findCause to reflect changed return type.
Copy link
Contributor

@ledsoft ledsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ledsoft ledsoft merged commit 1526072 into kbss-cvut:development Sep 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants