Function validateWithError
- validateWithError<T>(schema, data, options?): Promise<T["__outputType"]>
-
Type Parameters
-
T extends BaseObjectSchema
Parameters
-
schema: T
-
data: unknown
-
Optional
options: ValidateOptions<AnyObject>
Returns Promise<T["__outputType"]>
Same functionality as the yup validate function, but throws a BadRequestHttpError if there is an error.