Skip to content

Commit

Permalink
Expand exception message for #154.
Browse files Browse the repository at this point in the history
  • Loading branch information
ric2016 committed Apr 29, 2023
1 parent 4c52875 commit 4357a7d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions patchedWebtrees/SharedPlace.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 4357a7d

Please sign in to comment.