minor #13431 [Form] Improved exception message if the data class is not found (fabpot)

This PR was merged into the 2.3 branch.

Discussion
----------

[Form] Improved exception message if the data class is not found

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12359, #12367
| License       | MIT
| Doc PR        | -

Commits
-------

4145836 [Form] Improved exception message if the data class is not found
This commit is contained in:
Fabien Potencier 2015-01-16 22:23:29 +01:00
commit ec1cae8b14
1 changed files with 1 additions and 1 deletions

View File

@ -193,7 +193,7 @@ class FormConfigBuilder implements FormConfigBuilderInterface
self::validateName($name);
if (null !== $dataClass && !class_exists($dataClass)) {
throw new InvalidArgumentException(sprintf('The data class "%s" is not a valid class.', $dataClass));
throw new InvalidArgumentException(sprintf('Class "%s" not found. Is the "data_class" form option set correctly?', $dataClass));
}
$this->name = (string) $name;