When a form submission fails, errors must be identified in text, associated with the input that caused them, and announced to assistive technology.
WCAG 3.3.1 — Error Identification (Level A)
WCAG 3.3.3 — Error Suggestion (Level AA)