Show:

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 | | null

    The Validator used to create this error, if any.

  • context ContextObject | | null

    The Context object used in conjunction with the Validator to create this error.

  • errorMessage String

    The actual error message

  • [key] String optional

    An optional key used to define a key for this error. One will be created automatically if not provided here.

getKey

(
  • validator
  • [propertyName]
)
String static

Composes a ValidationError 'key' given a validator or an errorName and an optional propertyName

Parameters:

  • validator ValidatorOrErrorKey

    A Validator or an "error name" if no validator is available.

  • [propertyName] Object optional

    A property name

Returns:

String:

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

validator

Validator

The Validator associated with this ValidationError.

readOnly