Skip to content
Source
Sign inSign up
TanStack/form
Open History to see the last commit

error.ts

18 lines510 Bytes

1import type { ServerFormState } from './types'
2​
3interface ServerValidateErrorState<TFormData> {
4 formState: ServerFormState<TFormData>
5}
6​
7export class ServerValidateError<TFormData>
8 extends Error
9 implements ServerValidateErrorState<TFormData>
11 formState: ServerFormState<TFormData>
12​
13 constructor(options: ServerValidateErrorState<TFormData>) {
14 super('Your form has errors. Please check the fields and try again.')
15 this.name = 'ServerValidateError'
16 this.formState = options.formState
17 }