io.quarkus.funqy.lambda.event.EventErrorHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-funqy-amazon-lambda Show documentation
Show all versions of quarkus-funqy-amazon-lambda Show documentation
Amazon Lambda Binding for Quarkus Funqy framework
The newest version!
package io.quarkus.funqy.lambda.event;
import java.util.ArrayList;
import java.util.List;
import io.smallrye.mutiny.Uni;
public class EventErrorHandler {
private final List failures = new ArrayList<>();
public Uni> collectFailures(Uni> uni, String id) {
return uni.onTermination().invoke((item, failure, cancellation) -> {
Throwable actualFailure = null;
if (failure != null) {
actualFailure = failure;
} else if (cancellation) {
actualFailure = new RuntimeException("Stream cancelled");
}
if (actualFailure != null) {
failures.add(id);
}
}).onFailure().recoverWithNull();
}
public List getFailures() {
return failures;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy