Skip to content

Miscellaneous

errorCount()

errorCount() — returns any

Returns the number of errors this object has associated with it. Specify property or name if you wish to count only specific errors.

NameTypeRequiredDefaultDescription
propertystringyesSpecify a property name here if you want to count only errors set on a specific property.
namestringyesSpecify an error name here if you want to count only errors set with a specific error name.
errorCount([ property, name ]) <!--- Check how many errors are set on the object --->
<cfif author.errorCount() GTE 10>
    <!--- Do something to deal with this very erroneous author here... --->
</cfif>

<!--- Check how many errors are associated with the `email` property --->
<cfif author.errorCount("email") gt 0>
    <!--- Do something to deal with this erroneous author here... --->
</cfif>