Skip to content

Commit

Permalink
Merge pull request #20742 from eileenmcnaughton/throw
Browse files Browse the repository at this point in the history
Throw exception rather than fatal
  • Loading branch information
colemanw authored Jul 1, 2021
2 parents 5e0e94e + 8567ce4 commit a25640f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Civi/Api4/Service/Spec/SpecGatherer.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,13 @@ private function getCustomGroupFields($customGroup, RequestSpec $specification)
* @param string $entityName
*
* @return array
* @throws \API_Exception
*/
private function getDAOFields($entityName) {
private function getDAOFields(string $entityName): array {
$bao = CoreUtil::getBAOFromApiName($entityName);

if (!$bao) {
throw new \API_Exception('Entity not loaded' . $entityName);
}
return $bao::getSupportedFields();
}

Expand Down

0 comments on commit a25640f

Please sign in to comment.