Skip to content

Commit 66834df

Browse files
committed
[Form] Improved exception message if the data class is not found
1 parent 30f65c7 commit 66834df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)