Skip to content

Commit ec1cae8

Browse files
committed
minor symfony#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 | symfony#12359, symfony#12367 | License | MIT | Doc PR | - Commits ------- 4145836 [Form] Improved exception message if the data class is not found
2 parents 7fdb07b + 4145836 commit ec1cae8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Form/FormConfigBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public function __construct($name, $dataClass, EventDispatcherInterface $dispatc
193193
self::validateName($name);
194194

195195
if (null !== $dataClass && !class_exists($dataClass)) {
196-
throw new InvalidArgumentException(sprintf('The data class "%s" is not a valid class.', $dataClass));
196+
throw new InvalidArgumentException(sprintf('Class "%s" not found. Is the "data_class" form option set correctly?', $dataClass));
197197
}
198198

199199
$this->name = (string) $name;

0 commit comments

Comments
 (0)