I have a code as follows. I am trying to zip the content. p1Mono and p2Mono are API calls to remote services. They throw various response HTTP response codes. How do I handle those API failures and return the exception with the corresponding codes?
return Mono.zip(p1Mono,
p2Mono).flatMap(data -> {
P1 p1 = data.getT1();
p2 p2 = data.getT2();
//some operation and combine result to p
return Mono.just(p);
});