Grokking Spring Boot
Vote

0% completed

​

Rollback Rules

public class PaymentUnavailableException extends Exception { public PaymentUnavailableException(String message) { super(message); } }

The payment client throws this exception when the provider at payments.example.com does not answer. It extends Exception, not RuntimeException, so it is a checked exception. The compiler makes every caller either catch it or declare it with throws. BookingService.book declares it, and book carries @Transactional.

We made the provider fail this way during Ben's request for seat A12. The caller caught the exception as expected

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content