Skip to content

Commit 1e096d8

Browse files
apergosjakobw
authored andcommitted
log the errant entityId and targetId in entityRedirect exceptions
This will make trackng down the source of such exceptions from MediaWiki instances easier.
1 parent 479399e commit 1e096d8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Entity/EntityRedirect.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ class EntityRedirect {
3333
public function __construct( EntityId $entityId, EntityId $targetId ) {
3434
if ( $entityId->getEntityType() !== $targetId->getEntityType() ) {
3535
throw new InvalidArgumentException(
36-
'$entityId and $targetId must refer to the same kind of entity.'
36+
'$entityId (' . $entityId . ') and $targetId (' . $targetId . ') must refer to the same kind of entity.'
3737
);
3838
}
3939

4040
if ( $entityId->getSerialization() === $targetId->getSerialization() ) {
41-
throw new InvalidArgumentException( '$entityId and $targetId can not be the same.' );
41+
throw new InvalidArgumentException( '$entityId (' . $entityId . ') and $targetId can not be the same.' );
4242
}
4343

4444
$this->entityId = $entityId;

0 commit comments

Comments
 (0)