Flag a field-level validation error.
$element: An array containing the form element for the widget. The error needs to be flagged on the right sub-element, according to the widget's internal structure.
$error: An associative array with the following key-value pairs, as returned by hook_field_validate():
$form: The form structure where field elements are attached to. This might be a full form structure, or a sub-element of a larger form.
$form_state: An associative array containing the current state of the form.
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
function hook_field_widget_error($element, $error, $form, &$form_state) {
form_error($element, $error['message']);
}