Skip to content

Commit

Permalink
do not verify warnings if a fatal error is present
Browse files Browse the repository at this point in the history
  • Loading branch information
ix0rai committed Jul 5, 2024
1 parent 04ee96e commit 67e1587
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,23 @@ public void raise(Message message, Object... args) {
public boolean canProceed() {
List<ParameterizedMessage> messagesCopy = new ArrayList<>(this.messages);

if (this.verifyWarnings) {
for (ParameterizedMessage m : messagesCopy) {
if (m.getType() == Message.Type.WARNING) {
this.messages.remove(m);
if (!this.notifier.verifyWarning(m)) {
return false;
boolean hasError = this.messages.stream().noneMatch(m -> m.message().getType() == Message.Type.ERROR);
if (hasError) {
return false;
} else {
if (this.verifyWarnings) {
for (ParameterizedMessage m : messagesCopy) {
if (m.getType() == Message.Type.WARNING) {
this.messages.remove(m);
if (!this.notifier.verifyWarning(m)) {
return false;
}
}
}
}
}

return this.messages.stream().noneMatch(m -> m.message().getType() == Message.Type.ERROR);
return true;
}
}

/**
Expand Down

0 comments on commit 67e1587

Please sign in to comment.