Back

allErrors()

Returns an array of all the errors on the object. It does this by storing instances of models that are associations, and not checking associations of those instances because they have already been checked.

Name Type Required Default Description
includeAssociations boolean No false
seenErrors array No [runtime expression] is a private argument not meant to be used by the user, the function uses this to ensure circular dependency avoidance.
// Get all the errors for the `user` object.
errorInfo = user.allErrors();

// Sample return of method.
[
	{
  	message: 'Username must not be blank.',
    name: 'usernameError',
    property: 'username'
  },
  {
  	message: 'Password must not be blank.',
    name: 'passwordError',
    property: 'password'
  }
]
Copied!