When persisting domain objects using Grails/GORM I frequently find myself wondering why a save() call fails.
This can easily be solved by adding the logic:
if (!o.save()) {
o.errors.allErrors.each { println it }
}
However, adding this everywhere I do a .save() adds a lot of duplicate code. In the spirit of DRY I'd like to configure Grails/GORM to automatically print any save-errors to the console (stderr). Is that possible? If not, how do I extend GORM to make it possible?