get_form_errors

A convient function if you are handling form errors. Under the hood the drupal form_get_errors is called. The result is then mapped upon a new array index by the form field name, with the error(s) as value.

{% set errors = get_form_errors() %}