Open History to see the last commit
1import type { ServerFormState } from './types'
2β
3interface ServerValidateErrorState<TFormData> {
4 formState: ServerFormState<TFormData>
5 response: Response
6}
7β
8export class ServerValidateError<TFormData>
9 extends Error
10 implements ServerValidateErrorState<TFormData>
11{
12 response: Response
13 formState: ServerFormState<TFormData>
14β
15 constructor(options: ServerValidateErrorState<TFormData>) {
16 super('Your form has errors. Please check the fields and try again.')
17 this.name = 'ServerValidateError'
18 this.response = options.response
19 this.formState = options.formState
20 }
21}