Skip to content

Commit aae2572

Browse files
authored
Made exception more helpful
The exception did not provide adequate context for chasing down the root cause of the error. By adding the field name and affected entity, locating the issue is considerably easier.
1 parent 8f25b2f commit aae2572

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Gedmo/SoftDeleteable/Mapping/Validator.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ public static function validateField(ClassMetadata $meta, $field)
3838
$fieldMapping = $meta->getFieldMapping($field);
3939

4040
if (!in_array($fieldMapping['type'], self::$validTypes)) {
41-
throw new InvalidMappingException(sprintf('Field "%s" must be of one of the following types: "%s"',
41+
throw new InvalidMappingException(sprintf('Field "%s" (type "%s") must be of one of the following types: "%s" in entity %s',
42+
$field,
4243
$fieldMapping['type'],
43-
implode(', ', self::$validTypes)));
44+
implode(', ', self::$validTypes),
45+
$meta->name));
4446
}
4547
}
4648
}

0 commit comments

Comments
 (0)