Grokking Spring Boot
0% completed
Handling Errors
Ana had booked seat A12 a minute earlier. When Ben tried to book the same seat, the booking service answered with the status 409 and this body.
{"timestamp":"...","status":409,"error":"Conflict","path":"/bookings"}
BookingService had thrown its exception with the reason "Seat is already taken", but the reason never reached Ben's app. The other failures were no better. A seat label of A31 returned 400 with the same four fields and no word about the field, and GET /bookings/42 returned 404 with an empty body.
An app cannot show Ben a useful message from these bodies
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%