Skip to content

Commit 96d14c6

Browse files
authored
Merge pull request #741 from wmde/idParsingException
Much more expressive exception in DispatchingEntityIdParser
2 parents f918088 + 0b70da1 commit 96d14c6

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Entity/DispatchingEntityIdParser.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ public function parse( $idSerialization ) {
6868
*/
6969
private function assertIdIsString( $idSerialization ) {
7070
if ( !is_string( $idSerialization ) ) {
71-
throw new EntityIdParsingException( '$idSerialization must be a string' );
71+
throw new EntityIdParsingException(
72+
'$idSerialization must be a string, got ' . ( is_object( $idSerialization )
73+
? get_class( $idSerialization )
74+
: getType( $idSerialization ) )
75+
);
7276
}
7377
}
7478

0 commit comments

Comments
 (0)