diff --git a/core/lib/Drupal/Core/Form/FormStateInterface.php b/core/lib/Drupal/Core/Form/FormStateInterface.php
index 26485a0..601b169 100644
--- a/core/lib/Drupal/Core/Form/FormStateInterface.php
+++ b/core/lib/Drupal/Core/Form/FormStateInterface.php
@@ -487,10 +487,12 @@ public static function hasAnyErrors();
    * skipped.
    *
    * @param string $name
-   *   The name of the form element. If the #parents property of your form
-   *   element is array('foo', 'bar', 'baz') then you may set an error on 'foo'
-   *   or 'foo][bar][baz'. Setting an error on 'foo' sets an error for every
-   *   element where the #parents array starts with 'foo'.
+   *   The name of the form element.
+   *   - If it is an empty string, the error will be set for the form.
+   *   - If the #parents property of your form element is
+   *     @code array('foo', 'bar', 'baz') @endcode then you may set an error on
+   *     'foo' or 'foo][bar][baz'. Setting an error on 'foo' sets an error for
+   *     every element where the #parents array starts with 'foo'.
    * @param string $message
    *   (optional) The error message to present to the user.
    *
diff --git a/core/tests/Drupal/Tests/Core/Form/FormStateTest.php b/core/tests/Drupal/Tests/Core/Form/FormStateTest.php
index 69118a8..ad10607 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormStateTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormStateTest.php
@@ -111,6 +111,7 @@ public function testSetErrorByName($limit_validation_errors, $expected_errors) {
     $form_state->setErrorByName('test', 'Fail 1');
     $form_state->setErrorByName('test', 'Fail 2');
     $form_state->setErrorByName('options');
+    $form_state->setErrorByName('', 'Empty Name Fail 1');
 
     $this->assertSame(!empty($expected_errors), $form_state::hasAnyErrors());
     $this->assertSame($expected_errors, $form_state->getErrors());
@@ -122,7 +123,7 @@ public function providerTestSetErrorByName() {
       array(array(array('options')), array('options' => '')),
       // Do not limit an validation, and, ensuring the first error is returned
       // for the 'test' element.
-      [NULL, ['test' => 'Fail 1', 'options' => '']],
+      [NULL, ['test' => 'Fail 1', 'options' => '', '' => 'Empty Name Fail 1']],
       // Limit all validation.
       array(array(), array()),
     );
