When a validation error occurs, Django raises a ValidationError exception. You can catch this exception in your view or form and handle it accordingly, such as displaying the error message to the user or logging the error for debugging purposes.