(Quick Reference)

clearErrors

目的
Purpose

Resets the list of errors on a domain class. This may be useful if a domain class contains errors because of binding problems or validation problems. The errors may be corrected programatically. Validation may continue to fail unless the errors are cleared.

使用例
Examples

def b = new Book(title: "The Shining")
b.validate()
if (b.hasErrors()) {

// clear the list of errors b.clearErrors()

// fix the validation issues b.author = "Stephen King"

// re-validate b.validate() }