diff --git a/src/Symfony/Component/Form/ButtonBuilder.php b/src/Symfony/Component/Form/ButtonBuilder.php index 2f0cbee06d..e40eecccc9 100644 --- a/src/Symfony/Component/Form/ButtonBuilder.php +++ b/src/Symfony/Component/Form/ButtonBuilder.php @@ -13,6 +13,7 @@ namespace Symfony\Component\Form; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Form\Exception\FormException; +use Symfony\Component\Form\Exception\InvalidArgumentException; /** * A builder for {@link Button} instances. @@ -62,7 +63,7 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface public function __construct($name, array $options) { if (empty($name) && 0 != $name) { - throw new FormException('Buttons cannot have empty names.'); + throw new InvalidArgumentException('Buttons cannot have empty names.'); } $this->name = (string) $name; diff --git a/src/Symfony/Component/Form/Exception/InvalidArgumentException.php b/src/Symfony/Component/Form/Exception/InvalidArgumentException.php new file mode 100644 index 0000000000..a270e0ce9e --- /dev/null +++ b/src/Symfony/Component/Form/Exception/InvalidArgumentException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Exception; + +/** + * Base InvalidArgumentException for the Form component. + * + * @author Bernhard Schussek + */ +class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface +{ +}