Skip to content

Commit

Permalink
fix: Better error reporting during validation.
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Sabadello <[email protected]>
  • Loading branch information
peacekeeper committed Mar 5, 2021
1 parent bd50aed commit 07b0c9b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

public class Validation {

private static void validateTrue(boolean valid) throws IllegalStateException {
private static void validateTrue(boolean valid) {

if (! valid) throw new IllegalStateException();
if (! valid) throw new RuntimeException();
}

private static void validateUrl(URI uri) {
Expand All @@ -31,6 +31,7 @@ private static void validateRun(Runnable runnable, String message) throws Illega
runnable.run();
} catch (Exception ex) {

if (ex.getMessage() != null && ! ex.getMessage().isEmpty()) message = message + " (" + ex.getMessage().trim() + ")";
throw new IllegalStateException(message);
}
}
Expand Down

0 comments on commit 07b0c9b

Please sign in to comment.