interface ManagedRecordValidationError

extends Error

Constructor for ManagedRecordValidationError errors, may be used by the ManagedRecord.validate method to encapsulate multiple errors.

If the arguments list includes another validation error, its encapsulated errors are added to the list instead of the ManagedRecordValidationError object itself.

See Also

ManagedRecord.validate(), ManagedRecord.isValidationError()


// class that extends some other class defined elsewhere
class MyRecord extends SomeOtherRecord {
  // this property is validated below:
  name?: string;

  validate() {
    // validate other fields first
    let errors: any[] = [];
    try { super.validate() }
    catch (err) { errors.push(err) }

    // validate own property:
    if (! {
      errors.push("Name cannot be left blank");
    if (errors.length) {
      throw new ManagedRecordValidationError(...errors);



Validation error flag, always set to true.


({} | Error)[]

List of encapsulated errors.