Skip to content

Interface: ValidationError ​

Extends ​

  • Error

Properties ​

PropertyTypeDescriptionOverridesInherited from
_originalany---
cause?unknown--Error.cause
detailsValidationErrorItem[]array of errors.--
isJoiboolean---
messagestring--Error.message
name"ValidationError"-Error.name-
stack?string--Error.stack

Methods ​

annotate() ​

ts
annotate(stripColors?: boolean): string;

function that returns a string with an annotated version of the object pointing at the places where errors occurred.

NOTE: This method does not exist in browser builds of Joi

Parameters ​

ParameterTypeDescription
stripColors?booleanif truthy, will strip the colors out of the output.

Returns ​

string