title: “grails.validation.ValidationErrors: 0 errors” while saving a domain class
body: <p>I have the following domain class:</p>
  
  <pre><code>class StudentQuiz {
        Date dateCreated
        Date lastUpdated
        Quiz quiz
        float price
        Student student
        Date startTime
        Date endTime
        int score
        List answers
        static hasMany = [answers:Answer]
        static constraints = {
           answers nullable:true
        }
  
  }
  </code></pre>
  
  <p>But when I use the following code to save an instance of this class:</p>
  
  <pre><code> studentInstance =  (Student)User.findByEmailAndPassword(params.email, params.password.toString().encodeAsPassword())
   if (studentInstance) {
      StudentQuiz studentQuizInstance = new StudentQuiz(score:0,  quiz:quizInstance,price:quizInstance.price,student:studentInstance,startTime:new Date())
      if (!studentQuizInstance.save(flush:true)) {                    
        studentInstance.errors.each {
              println "===="+it+"-------"
          }
  }
  </code></pre>
  
  <p>I am getting this:</p>
  
  <pre><code>grails.validation.ValidationErrors: 0 errors
  </code></pre>
  
  <p>with no other explanation of the error. Any help would be really appreciated.</p>