More grails fun

Hidden validation error messages

If you have a def book = new Book(title:’Ala ma Kota’).save() and the constraints are violated by it, you’ll get a null returned from save() as a result.  But how to find what is the problem with new Book()?  Well, it’s a secret.  Use book.errors.allErrors to get the list of errors and println  on them.  And by the way, they will not show up in the unit test stdout.  See next bullet for this.

Hidden unit test error log

Unit tests send errors to a file well hidden in /target folder.