import { LimeObject } from './limeobject'; /** * @public * @group Lime objects */ export interface SaveLimeObjectError extends Error { /** * The limeobject that could not be saved */ limeobject: LimeObject; /** * Validation error messages */ errors?: ValidationError; } /** * Describes a hierarchy of errors after validation has failed. The error * object will have the same structure as the object being validated, e.g. each * key in the error will have a corresponding key in the validated object. * * @example Errors for a name field and a nested address * ```ts * import { ValidationError } from '@limetech/lime-web-components'; * * const errors: ValidationError = { * name: ['Length can not be more than 15', 'Contains invalid characters'], * address: { * city: ['City does not exist'], * zipcode: ['Invalid zipcode'], * }, * }; * ``` * * @public */ export interface ValidationError { /** * Name of the field the error belongs to */ [key: string]: string[] | ValidationError; }