ValidationError Class
A ValidationError is used to describe a failed validation.
Methods
<ctor> ValidationError
-
validator
-
context
-
errorMessage
-
[key]
Constructs a new ValidationError
Parameters:
-
validator
Validator | | nullThe Validator used to create this error, if any.
-
context
ContextObject | | nullThe Context object used in conjunction with the Validator to create this error.
-
errorMessage
StringThe actual error message
-
[key]
String optionalAn optional key used to define a key for this error. One will be created automatically if not provided here.
getKey
-
validator
-
[propertyName]
Composes a ValidationError 'key' given a validator or an errorName and an optional propertyName
Parameters:
-
validator
ValidatorOrErrorKeyA Validator or an "error name" if no validator is available.
-
[propertyName]
Object optionalA property name
Returns:
A ValidationError 'key'
Properties
context
Object
A 'context' object associated with this ValidationError.
readOnly
errorMessage
String
The error message associated with the ValidationError.
readOnly
isServerError
Bool
Whether this is a server error.
readOnly
key
String
The key by which this validation error may be removed from a collection of ValidationErrors.
readOnly
property
DataProperty | NavigationProperty
The DataProperty or NavigationProperty associated with this ValidationError.
readOnly
propertyName
String
The property name associated with this ValidationError. This will be a "property path" for any properties of a complex object.
readOnly