You don't do anything important in you catch block. What will codenarc will say on this(move return to try block):
def finishBooking() {
Booking booking = new Booking(params)
try {
booking = bookingService.saveBooking(booking)
if (!booking.hasErrors()) {
return [booking: booking]
} else {
flash.message = "Reservation failed. Check the required fields."
}
} catch (ReservationException e) {
log.error("Error saving booking", e)
flash.message = "Couldn't save the reservation."
}
render(view: "index", model: [booking: booking])
}
P.S. Thanks for the link. Never heard about codenarc.