Skip to content

Commit

Permalink
Merge pull request #16759 from eileenmcnaughton/fatal2
Browse files Browse the repository at this point in the history
Remove instances of fatal
  • Loading branch information
seamuslee001 authored Mar 13, 2020
2 parents 6a1f8c6 + bc660dd commit 530f7d9
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions CRM/Contact/BAO/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public static function add(&$params) {
) {
// we'll need to fix tests to handle this
// CRM-7925
CRM_Core_Error::fatal(ts('The Contact Sub Type does not match the Contact type for this record'));
throw new CRM_Core_Exception(ts('The Contact Sub Type does not match the Contact type for this record'));
}
$params['contact_sub_type'] = CRM_Utils_Array::implodePadded($params['contact_sub_type']);
}
Expand Down Expand Up @@ -295,12 +295,6 @@ public static function &create(&$params, $fixAddress = TRUE, $invokeHooks = TRUE
$transaction = new CRM_Core_Transaction();

$contact = self::add($params);
if (!$contact) {
// Not dying here is stupid, since we get into weird situation and into a bug that
// is impossible to figure out for the user or for us
// CRM-7925
CRM_Core_Error::fatal();
}

$params['contact_id'] = $contact->id;

Expand Down

0 comments on commit 530f7d9

Please sign in to comment.