I have a form. My JS confirms the field values are valid before the form can be submitted. If invalid, it is highlighted red, focused, and given a tooltip with the reason.
Moreover, the Javascript will only submit the AJAX request if the entire form is valid; if any field is invalid, it won't submit the form (and submission is handled by the Javascript, so if Javascript is disabled, the form can't be submitted at all). Therefore, no legitimate user will ever submit an erroneous form: the only way to submit an invalid form is for the user to send their own AJAX request or tamper with the Javascript. In other words, theoretically, no user should ever submit an invalid form.
Of course, I do verify and sanitize data server-side. If this validation fails, the client is given a generic error, which is shown to the end user.
My question is as follows: Should I make the generic error more specific?