Implement exit code for rate limiting error

Closes #1240
This commit is contained in:
AsamK 2023-10-13 19:35:29 +02:00
parent af4709255a
commit 56ee173d03
6 changed files with 30 additions and 3 deletions

View file

@ -19,4 +19,11 @@ public record SendMessageResults(long timestamp, Map<RecipientIdentifier, List<S
.allMatch(identityFailure -> identityFailure)
&& results.values().stream().mapToInt(List::size).sum() > 0;
}
public boolean hasOnlyRateLimitFailure() {
return results.values()
.stream()
.flatMap(res -> res.stream().map(SendMessageResult::isRateLimitFailure))
.allMatch(r -> r) && results.values().stream().mapToInt(List::size).sum() > 0;
}
}