Skip to content

Commit 0b70da1

Browse files
committed
Much more expressive exception in DispatchingEntityIdParser
1 parent f918088 commit 0b70da1

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)