/** * @param ItemId $itemId * @param string|null $message * @param Exception|null $previous */ public function __construct(ItemId $itemId, $message = null, Exception $previous = null) { parent::__construct($itemId, $message ?: 'Item lookup failed for: ' . $itemId, $previous); }
/** * Registers an exception that will be thrown when a entity with the id in the exception is requested. * If an exception with the same EntityId was already present it will be replaced by the new one. * * @since 3.1 * * @param EntityLookupException $exception */ public function addException(EntityLookupException $exception) { $this->exceptions[$exception->getEntityId()->getSerialization()] = $exception; }
/** * @param EntityId $entityId * @param EntityId $redirectTargetId The ID of the target Entity of the redirect * @param string|null $message Added in 3.1 * @param Exception|null $previous Added in 3.1 */ public function __construct(EntityId $entityId, EntityId $redirectTargetId, $message = null, Exception $previous = null) { parent::__construct($entityId, $message !== null ? $message : 'Unresolved redirect to ' . $redirectTargetId->getSerialization(), $previous); $this->redirectTargetId = $redirectTargetId; }
/** * @param PropertyId $propertyId * @param string|null $message * @param Exception|null $previous */ public function __construct(PropertyId $propertyId, $message = null, Exception $previous = null) { parent::__construct($propertyId, $message ?: 'Property lookup failed for: ' . $propertyId, $previous); }
public function testConstructorWithJustAnId() { $propertyId = new PropertyId('P42'); $exception = new EntityLookupException($propertyId); $this->assertEquals($propertyId, $exception->getEntityId()); }