From 4357a7df7d9033816ed400bc932055fadec1954d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Ciss=C3=A9e?= Date: Sat, 29 Apr 2023 11:01:11 +0200 Subject: [PATCH] Expand exception message for #154. --- patchedWebtrees/SharedPlace.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/patchedWebtrees/SharedPlace.php b/patchedWebtrees/SharedPlace.php index ad588fe..957663a 100644 --- a/patchedWebtrees/SharedPlace.php +++ b/patchedWebtrees/SharedPlace.php @@ -1484,7 +1484,10 @@ public function primaryPlace(): Place { return $this->primaryPlaceAt(GedcomDateInterval::createNow()); } - public function primaryPlaceAt(GedcomDateInterval $date, ?string $query = null): Place { + public function primaryPlaceAt( + GedcomDateInterval $date, + ?string $query = null): Place { + $firstMatch = null; if ($query !== null) { @@ -1519,7 +1522,7 @@ public function primaryPlaceAt(GedcomDateInterval $date, ?string $query = null): $this->getTransitiveParentsAt($date)); if (sizeof($namesAsString) === 0) { - throw new \Exception("unexpectedly empty!"); + throw new \Exception("unexpectedly empty for " . $firstMatch['fullNN'] . " at date " . $date->toGedcomString(0, true)); } if (sizeof($namesAsString) !== 1) {