Commit ddbaf424 authored by KevinLevie's avatar KevinLevie
Browse files

Change exception types in entity classes (etc)

parent e37ad26a
......@@ -15,13 +15,13 @@ class CRM_Civiconfig_Entity_ActivityType extends CRM_Civiconfig_Entity_OptionVal
*/
protected function validateCreateParams($params) {
if (!isset($params['name']) || empty($params['name'])) {
throw new Exception('Missing mandatory param name in class CRM_Civiconfig_ActivityType');
throw new \CRM_Civiconfig_EntityException("Missing mandatory parameter 'name' in class " . get_class() . ".");
}
$this->_apiParams = $params;
try {
$this->_apiParams['option_group_id'] = $this->getOptionGroupId();
} catch (CiviCRM_API3_Exception $ex) {
throw new Exception('Unable to find option group for activity_type in CRM_Civiconfig_ActivityType, contact your system administrator');
} catch (\CiviCRM_API3_Exception $ex) {
throw new \CRM_Civiconfig_EntityException("Unable to find option group for activity_type in " . get_class() . ", contact your system administrator.");
}
}
......
......@@ -18,7 +18,7 @@ class CRM_Civiconfig_Entity_ContactType extends CRM_Civiconfig_Entity {
*/
protected function validateCreateParams($params) {
if (!isset($params['name']) || empty($params['name'])) {
throw new Exception('Missing mandatory param name in class CRM_Civiconfig_ContactType');
throw new \CRM_Civiconfig_EntityException("Missing mandatory parameter 'name' in class " . get_class() . ".");
}
$this->_apiParams = $params;
}
......@@ -42,9 +42,9 @@ class CRM_Civiconfig_Entity_ContactType extends CRM_Civiconfig_Entity {
try {
civicrm_api3('ContactType', 'Create', $this->_apiParams);
$this->updateNavigationMenuUrl();
} catch (CiviCRM_API3_Exception $ex) {
throw new Exception('Could not create or update contact type with name '.$this->_apiParams['name']
.', error from API ContactType Create: '.$ex->getMessage());
} catch (\CiviCRM_API3_Exception $ex) {
throw new \CRM_Civiconfig_EntityException('Could not create or update contact type with name '.$this->_apiParams['name']
.'. Error from API ContactType.Create: '.$ex->getMessage().'.');
}
}
......@@ -91,7 +91,7 @@ class CRM_Civiconfig_Entity_ContactType extends CRM_Civiconfig_Entity {
public function getWithName($contactTypeName) {
try {
return civicrm_api3('ContactType', 'Getsingle', array('name' => $contactTypeName));
} catch (CiviCRM_API3_Exception $ex) {
} catch (\CiviCRM_API3_Exception $ex) {
return FALSE;
}
}
......
......@@ -26,8 +26,7 @@ class CRM_Civiconfig_Entity_CustomField extends CRM_Civiconfig_Entity {
private function validateCreateParams($params) {
if (!isset($params['name']) || empty($params['name']) || !isset($params['custom_group_id'])
|| empty($params['custom_group_id'])) {
throw new Exception('When trying to create a Custom Field name and custom_group_id are
mandatory parameters and can not be empty in class CRM_Civiconfig_CustomField');
throw new \CRM_Civiconfig_EntityException("Missing mandatory parameters 'name' and/or 'custom_group_id' in class " . get_class() . ".");
}
$this->_apiParams = $params;
if (isset($this->_apiParams['option_group'])) {
......@@ -64,9 +63,9 @@ class CRM_Civiconfig_Entity_CustomField extends CRM_Civiconfig_Entity {
if (isset($params['option_group'])) {
$this->fixOptionGroups($customField['values'], $params['option_group']);
}
} catch (CiviCRM_API3_Exception $ex) {
throw new Exception('could not create or update custom field with name '.$this->_apiParams['name']
.' in custom group '.$this->_apiParams['custom_group_id'].' error from API CustomField Create: '.$ex->getMessage());
} catch (\CiviCRM_API3_Exception $ex) {
throw new \CRM_Civiconfig_EntityException('Could not create or update custom field with name '.$this->_apiParams['name']
.' in custom group '.$this->_apiParams['custom_group_id'].'. Error from API CustomField.Create: '.$ex->getMessage() . '.');
}
}
......@@ -80,7 +79,7 @@ class CRM_Civiconfig_Entity_CustomField extends CRM_Civiconfig_Entity {
public function getWithNameCustomGroupId($name, $customGroupId) {
try {
return civicrm_api3('CustomField', 'Getsingle', array('name' => $name, 'custom_group_id' => $customGroupId));
} catch (CiviCRM_API3_Exception $ex) {
} catch (\CiviCRM_API3_Exception $ex) {
return FALSE;
}
}
......@@ -130,7 +129,7 @@ class CRM_Civiconfig_Entity_CustomField extends CRM_Civiconfig_Entity {
civicrm_api3('CustomField', 'Delete', array('id' => $existingId));
}
}
} catch (CiviCRM_API3_Exception $ex) {
} catch (\CiviCRM_API3_Exception $ex) {
return FALSE;
}
return TRUE;
......
......@@ -28,8 +28,7 @@ class CRM_Civiconfig_Entity_CustomGroup extends CRM_Civiconfig_Entity {
private function validateCreateParams($params) {
if (!isset($params['name']) || empty($params['name']) || !isset($params['extends']) ||
empty($params['extends'])) {
throw new Exception('When trying to create a Custom Group name and extends are mandatory parameters
and can not be empty in class CRM_Civiconfig_CustomGroup');
throw new \CRM_Civiconfig_EntityException("Missing mandatory parameter 'name' and/or 'extends' in class " . get_class() . ".");
}
$this->buildApiParams($params);
}
......@@ -54,10 +53,10 @@ class CRM_Civiconfig_Entity_CustomGroup extends CRM_Civiconfig_Entity {
}
try {
$customGroup = civicrm_api3('CustomGroup', 'Create', $this->_apiParams);
} catch (CiviCRM_API3_Exception $ex) {
throw new Exception('Could not create or update custom group with name ' . $this->_apiParams['name']
. ' to extend ' . $this->_apiParams['extends'] . ', error from API CustomGroup Create: ' .
$ex->getMessage() . ", parameters : " . implode(";", $this->_apiParams));
} catch (\CiviCRM_API3_Exception $ex) {
throw new \CRM_Civiconfig_EntityException('Could not create or update custom group with name ' . $this->_apiParams['name']
. ' to extend ' . $this->_apiParams['extends'] . '. Error from API CustomGroup.Create: ' .
$ex->getMessage() . ", parameters : " . implode(";", $this->_apiParams) . '.');
}
$created = $customGroup['values'][$customGroup['id']];
......@@ -81,7 +80,7 @@ class CRM_Civiconfig_Entity_CustomGroup extends CRM_Civiconfig_Entity {
public function getWithName($name) {
try {
return civicrm_api3('CustomGroup', 'Getsingle', array('name' => $name));
} catch (CiviCRM_API3_Exception $ex) {
} catch (\CiviCRM_API3_Exception $ex) {
return FALSE;
}
}
......@@ -104,7 +103,7 @@ class CRM_Civiconfig_Entity_CustomGroup extends CRM_Civiconfig_Entity {
if (isset($this->_apiParams['extends_entity_column_value']) && !empty($this->_apiParams['extends_entity_column_value'])) {
if (is_array($this->_apiParams['extends_entity_column_value'])) {
foreach ($this->_apiParams['extends_entity_column_value'] as $extendsValue) {
$activityType = new CRM_Civiconfig_ActivityType();
$activityType = new CRM_Civiconfig_Entity_ActivityType();
$found = $activityType->getWithNameAndOptionGroupId($extendsValue, $activityType->getOptionGroupId());
if (isset($found['value'])) {
$this->_apiParams['extends_entity_column_value'][] = $found['value'];
......@@ -164,7 +163,7 @@ class CRM_Civiconfig_Entity_CustomGroup extends CRM_Civiconfig_Entity {
if (isset($this->_apiParams['extends_entity_column_value']) && !empty($this->_apiParams['extends_entity_column_value'])) {
if (is_array($this->_apiParams['extends_entity_column_value'])) {
foreach ($this->_apiParams['extends_entity_column_value'] as $extendsValue) {
$eventType = new CRM_Civiconfig_EventType();
$eventType = new CRM_Civiconfig_Entity_EventType();
$found = $eventType->getWithNameAndOptionGroupId($extendsValue, $eventType->getOptionGroupId());
if (isset($found['value'])) {
$this->_apiParams['extends_entity_column_value'][] = $found['value'];
......
......@@ -15,13 +15,13 @@ class CRM_Civiconfig_Entity_EventType extends CRM_Civiconfig_Entity_OptionValue
*/
protected function validateCreateParams($params) {
if (!isset($params['name']) || empty($params['name'])) {
throw new Exception('Missing mandatory param name in class CRM_Civiconfig_EventType');
throw new \CRM_Civiconfig_EntityException("Missing mandatory parameter 'name' in class " . get_class() . ".");
}
$this->_apiParams = $params;
try {
$this->_apiParams['option_group_id'] = $this->getOptionGroupId();
} catch (CiviCRM_API3_Exception $ex) {
throw new Exception('Unable to find option group for event_type in CRM_Civiconfig_EventType, contact your system administrator');
} catch (\CiviCRM_API3_Exception $ex) {
throw new \CRM_Civiconfig_EntityException("Unable to find option group for event_type in " . get_class() . ", contact your system administrator.");
}
}
......
......@@ -24,7 +24,7 @@ class CRM_Civiconfig_Entity_Group extends CRM_Civiconfig_Entity {
*/
private function validateCreateParams($params) {
if (!isset($params['name']) || empty($params['name'])) {
throw new Exception('Missing mandatory param name in class CRM_Civiconfig_Group');
throw new \CRM_Civiconfig_EntityException("Missing mandatory parameter 'name' in class " . get_class() . ".");
}
$this->_apiParams = $params;
}
......@@ -57,9 +57,9 @@ class CRM_Civiconfig_Entity_Group extends CRM_Civiconfig_Entity {
try {
$group = civicrm_api3('Group', 'Create', $this->_apiParams);
$this->fixName($group);
} catch (CiviCRM_API3_Exception $ex) {
throw new Exception('Could not create or update group type with name'
.$this->_apiParams['name'].', error from API Group Create: ' . $ex->getMessage());
} catch (\CiviCRM_API3_Exception $ex) {
throw new \CRM_Civiconfig_EntityException('Could not create or update group type with name'
.$this->_apiParams['name'].'. Error from API Group.Create: ' . $ex->getMessage() . '.');
}
}
......@@ -73,7 +73,7 @@ class CRM_Civiconfig_Entity_Group extends CRM_Civiconfig_Entity {
public function getWithName($groupName) {
try {
return civicrm_api3('Group', 'Getsingle', array('name' => $groupName));
} catch (CiviCRM_API3_Exception $ex) {
} catch (\CiviCRM_API3_Exception $ex) {
return FALSE;
}
}
......
......@@ -25,8 +25,7 @@ class CRM_Civiconfig_Entity_LocationType extends CRM_Civiconfig_Entity {
*/
private function validateCreateParams($params) {
if (!isset($params['name']) || empty($params['name'])) {
throw new Exception('When trying to create a Location Type, name is mandatory
parameter and can not be empty in class ' . get_class());
throw new \CRM_Civiconfig_EntityException("Missing mandatory parameter 'name' in class " . get_class() . ".");
}
// The line below is in a strange place in the code. But I'll keep it
// there, because it is there as well for every other entity type.
......@@ -48,9 +47,9 @@ class CRM_Civiconfig_Entity_LocationType extends CRM_Civiconfig_Entity {
}
try {
civicrm_api3('LocationType', 'Create', $this->_apiParams);
} catch (CiviCRM_API3_Exception $ex) {
throw new Exception('Could not create or update location type with name '.$this->_apiParams['name']
.', error from API LocationType Create: '.$ex->getMessage());
} catch (\CiviCRM_API3_Exception $ex) {
throw new \CRM_Civiconfig_EntityException('Could not create or update location type with name '.$this->_apiParams['name']
.'. Error from API LocationType.Create: '.$ex->getMessage() . '.');
}
}
......@@ -66,7 +65,7 @@ class CRM_Civiconfig_Entity_LocationType extends CRM_Civiconfig_Entity {
try {
return civicrm_api3('LocationType', 'Getsingle',
array('name' => $name));
} catch (CiviCRM_API3_Exception $ex) {
} catch (\CiviCRM_API3_Exception $ex) {
return FALSE;
}
}
......
......@@ -25,8 +25,7 @@ class CRM_Civiconfig_Entity_MembershipType extends CRM_Civiconfig_Entity {
*/
private function validateCreateParams($params) {
if (!isset($params['name']) || empty($params['name'])) {
throw new Exception('When trying to create a Membership Type name is a mandatory parameter and
can not be empty in class CRM_Civiconfig_MembershipType');
throw new \CRM_Civiconfig_EntityException("Missing mandatory parameter 'name' in class " . get_class() . ".");
}
$this->_apiParams = $params;
}
......@@ -99,10 +98,10 @@ class CRM_Civiconfig_Entity_MembershipType extends CRM_Civiconfig_Entity {
$this->_apiParams['financial_type_id'] = civicrm_api3('FinancialType', 'Getvalue',
array('name' => $this->_apiParams['financial_type'], 'return' => 'id'));
unset($this->_apiParams['financial_type']);
} catch (CiviCRM_API3_Exception $ex) {
throw new Exception('Could not find a financial type with name ' . $this->_apiParams['financial_type']
} catch (\CiviCRM_API3_Exception $ex) {
throw new \CRM_Civiconfig_EntityException('Could not find a financial type with name ' . $this->_apiParams['financial_type']
. ', so the membership type with name' . $this->_apiParams['name'] . ' can not be updated or created.
Error from API FinancialType Getvalue: ' . $ex->getMessage());
Error from API FinancialType.Getvalue: ' . $ex->getMessage() . '.');
}
} else {
if (isset($existing['financial_type_id'])) {
......@@ -111,7 +110,7 @@ class CRM_Civiconfig_Entity_MembershipType extends CRM_Civiconfig_Entity {
try {
$this->_apiParams['financial_type_id'] = civicrm_api3('FinancialType', 'Getvalue',
array('name' => 'Member Dues', 'return' => 'id'));
} catch (CiviCRM_API3_Exception $ex) {
} catch (\CiviCRM_API3_Exception $ex) {
$this->_apiParams['financial_type_id'] = 1;
}
}
......@@ -156,10 +155,10 @@ class CRM_Civiconfig_Entity_MembershipType extends CRM_Civiconfig_Entity {
$this->_apiParams['member_of_contact_id'] = civicrm_api3('Contact', 'Getvalue',
array('sort_name' => $this->_apiParams['member_of_contact'], 'return' => 'id'));
unset($this->_apiParams['member_of_contact']);
} catch (CiviCRM_API3_Exception $ex) {
throw new Exception('Could not find a contact with sort_name ' . $this->_apiParams['member_of_contact']
} catch (\CiviCRM_API3_Exception $ex) {
throw new \CRM_Civiconfig_EntityException('Could not find a contact with sort_name ' . $this->_apiParams['member_of_contact']
. ', so the membership type with name' . $this->_apiParams['name']
. ' can not be updated or created. Error from API Contact Getvalue: ' . $ex->getMessage());
. ' can not be updated or created. Error from API Contact.Getvalue: ' . $ex->getMessage() . '.');
}
} else {
if (isset($existing['member_of_contact_id'])) {
......@@ -168,10 +167,10 @@ class CRM_Civiconfig_Entity_MembershipType extends CRM_Civiconfig_Entity {
try {
$this->_apiParams['member_of_contact_id'] = civicrm_api3('Domain', 'Getvalue',
array('id' => $this->_apiParams['domain_id'], 'return' => 'contact_id'));
} catch (CiviCRM_API3_Exception $ex) {
throw new Exception('Could not find a domain ' . $this->_apiParams['domain_id']
} catch (\CiviCRM_API3_Exception $ex) {
throw new \CRM_Civiconfig_EntityException('Could not find a domain ' . $this->_apiParams['domain_id']
. ', the membership type with name' . $this->_apiParams['name'] . ' can not be updated or created.
Error from API Domain Getvalue: ' . $ex->getMessage());
Error from API Domain Getvalue: ' . $ex->getMessage() . '.');
}
}
}
......@@ -198,8 +197,8 @@ class CRM_Civiconfig_Entity_MembershipType extends CRM_Civiconfig_Entity {
if (isset($this->_apiParams['visibility'])) {
$this->fixVisibility($membershipType['id'], $this->_apiParams['visibility']);
}
} catch (CiviCRM_API3_Exception $ex) {
throw new Exception('Could not create or update membership type with name '.$this->_apiParams['name']
} catch (\CiviCRM_API3_Exception $ex) {
throw new \CRM_Civiconfig_EntityException('Could not create or update membership type with name '.$this->_apiParams['name']
.', error from API MembershipType Create: '.$ex->getMessage());
}
}
......@@ -227,7 +226,7 @@ class CRM_Civiconfig_Entity_MembershipType extends CRM_Civiconfig_Entity {
public function getWithName($name) {
try {
return civicrm_api3('MembershipType', 'Getsingle', array('name' => $name));
} catch (CiviCRM_API3_Exception $ex) {
} catch (\CiviCRM_API3_Exception $ex) {
return FALSE;
}
}
......
......@@ -24,7 +24,7 @@ class CRM_Civiconfig_Entity_OptionGroup extends CRM_Civiconfig_Entity {
*/
protected function validateCreateParams($params) {
if (!isset($params['name']) || empty($params['name'])) {
throw new Exception('Missing mandatory param name in class CRM_Civiconfig_OptionGroup');
throw new \CRM_Civiconfig_EntityException("Missing mandatory parameter 'name' in class " . get_class() . ".");
}
$this->_apiParams = $params;
}
......@@ -52,9 +52,9 @@ class CRM_Civiconfig_Entity_OptionGroup extends CRM_Civiconfig_Entity {
if (isset($params['option_values'])) {
$this->processOptionValues($optionGroup['id'], $params['option_values']);
}
} catch (CiviCRM_API3_Exception $ex) {
throw new Exception('Could not create or update option_group with name'
.$this->_apiParams['name'].', error from API OptionGroup Create: ' . $ex->getMessage());
} catch (\CiviCRM_API3_Exception $ex) {
throw new \CRM_Civiconfig_EntityException('Could not create or update option_group with name'
.$this->_apiParams['name'].'. Error from API OptionGroup.Create: ' . $ex->getMessage() . '.');
}
}
......@@ -82,7 +82,7 @@ class CRM_Civiconfig_Entity_OptionGroup extends CRM_Civiconfig_Entity {
$params = array('name' => $name);
try {
return civicrm_api3('OptionGroup', 'Getsingle', $params);
} catch (CiviCRM_API3_Exception $ex) {
} catch (\CiviCRM_API3_Exception $ex) {
return array();
}
}
......
......@@ -24,10 +24,10 @@ class CRM_Civiconfig_Entity_OptionValue extends CRM_Civiconfig_Entity {
*/
protected function validateCreateParams($params) {
if (!isset($params['name']) || empty($params['name'])) {
throw new Exception('Missing mandatory param name in class CRM_Civiconfig_OptionValue');
throw new \CRM_Civiconfig_EntityException("Missing mandatory parameter 'name' in class " . get_class() . ".");
}
if (!isset($params['option_group_id']) || empty($params['option_group_id'])) {
throw new Exception('Missing mandatory param option_group_id in class CRM_Civiconfig_OptionValue');
throw new \CRM_Civiconfig_EntityException("Missing mandatory parameter 'option_group_id' in class " . get_class() . ".");
}
$this->_apiParams = $params;
}
......@@ -52,10 +52,10 @@ class CRM_Civiconfig_Entity_OptionValue extends CRM_Civiconfig_Entity {
}
try {
return civicrm_api3('OptionValue', 'Create', $this->_apiParams);
} catch (CiviCRM_API3_Exception $ex) {
throw new Exception('Could not create or update option_value with name'.$this->_apiParams['name']
.' in option group with id '.$this->_apiParams['option_group_id'].', error from API OptionValue Create: '
.$ex->getMessage());
} catch (\CiviCRM_API3_Exception $ex) {
throw new \CRM_Civiconfig_EntityException('Could not create or update option_value with name'.$this->_apiParams['name']
.' in option group with id '.$this->_apiParams['option_group_id'].'. Error from API OptionValue.Create: '
.$ex->getMessage() . '.');
}
}
......@@ -70,7 +70,7 @@ class CRM_Civiconfig_Entity_OptionValue extends CRM_Civiconfig_Entity {
$params = array('name' => $name, 'option_group_id' => $optionGroupId);
try {
return civicrm_api3('OptionValue', 'Getsingle', $params);
} catch (CiviCRM_API3_Exception $ex) {
} catch (\CiviCRM_API3_Exception $ex) {
return array();
}
}
......
......@@ -26,8 +26,7 @@ class CRM_Civiconfig_Entity_RelationshipType extends CRM_Civiconfig_Entity {
private function validateCreateParams($params) {
if (!isset($params['name_a_b']) || empty($params['name_a_b']) ||
!isset($params['name_b_a']) || empty($params['name_b_a'])) {
throw new Exception('When trying to create a Relationship Type name_a_b and name_b_a are mandatory
parameter and can not be empty in class CRM_CiviConfig_RelationshipType');
throw new \CRM_Civiconfig_EntityException("Missing mandatory parameter 'name_a_b' and/or 'name_b_a' in class " . get_class() . ".");
}
$this->_apiParams = $params;
}
......@@ -53,9 +52,9 @@ class CRM_Civiconfig_Entity_RelationshipType extends CRM_Civiconfig_Entity {
}
try {
civicrm_api3('RelationshipType', 'Create', $this->_apiParams);
} catch (CiviCRM_API3_Exception $ex) {
throw new Exception('Could not create or update relationship type with name '.$this->_apiParams['name_a_b']
.', error from API RelationshipType Create: '.$ex->getMessage());
} catch (\CiviCRM_API3_Exception $ex) {
throw new \CRM_Civiconfig_EntityException('Could not create or update relationship type with name '.$this->_apiParams['name_a_b']
.'. Error from API RelationshipType.Create: '.$ex->getMessage() . '.');
}
}
......@@ -71,7 +70,7 @@ class CRM_Civiconfig_Entity_RelationshipType extends CRM_Civiconfig_Entity {
try {
return civicrm_api3('RelationshipType', 'Getsingle',
array('name_a_b' => $nameAb));
} catch (CiviCRM_API3_Exception $ex) {
} catch (\CiviCRM_API3_Exception $ex) {
return FALSE;
}
}
......
......@@ -25,7 +25,7 @@ class CRM_Civiconfig_Entity_Tag extends CRM_Civiconfig_Entity {
*/
private function validateCreateParams($params) {
if (!isset($params['name']) || empty($params['name'])) {
throw new Exception('Missing mandatory param name when constructing class CRM_Civiconfig_Tag');
throw new \CRM_Civiconfig_EntityException("Missing mandatory parameter 'name' in class " . get_class() . ".");
}
$this->_apiParams = $params;
// if parent is set, retrieve parent number with name and set parents
......@@ -59,9 +59,9 @@ class CRM_Civiconfig_Entity_Tag extends CRM_Civiconfig_Entity {
}
try {
civicrm_api3('Tag', 'Create', $this->_apiParams);
} catch (CiviCRM_API3_Exception $ex) {
throw new Exception('Could not create or update tag type with name'
.$this->_apiParams['name'].', error from API Tag Create: ' . $ex->getMessage());
} catch (\CiviCRM_API3_Exception $ex) {
throw new \CRM_Civiconfig_EntityException('Could not create or update tag type with name'
.$this->_apiParams['name'].'. Error from API Tag.Create: ' . $ex->getMessage() . '.');
}
}
......@@ -76,7 +76,7 @@ class CRM_Civiconfig_Entity_Tag extends CRM_Civiconfig_Entity {
public function getWithName($name) {
try {
return civicrm_api3('Tag', 'Getsingle', array('name' => $name));
} catch (CiviCRM_API3_Exception $ex) {
} catch (\CiviCRM_API3_Exception $ex) {
return FALSE;
}
}
......
......@@ -2,9 +2,9 @@
/**
* Class CRM_Civiconfig_EntityException
* Exception thrown when an error occurs processing a single entity.
* (Further up, we'll consider this non fatal and continue processing other entity types.)
* This type of exception is thrown when an error occurs while processing a single entity type.
* (Further up, we'll consider this non-fatal and continue processing other items.)
*/
class CRM_Civiconfig_EntityException extends \Exception {
}
\ No newline at end of file
}
......@@ -2,8 +2,8 @@
/**
* Class CRM_Civiconfig_Exception
* Exception thrown when a general error occurs (will be considered fatal further up).
* This type of exception is thrown when a general error occurs (will be considered fatal further up).
*/
class CRM_Civiconfig_Exception extends \Exception {
}
\ No newline at end of file
}
......@@ -52,8 +52,8 @@ class CRM_Civiconfig_Utils {
$valueList[0] = ts('- select -');
asort($valueList);
} catch (\CiviCRM_API3_Exception $ex) {
throw new Exception('Could not find an option group with name '.$optionGroupName
.' contact your system administrator. Error from API OptionGroup Getvalue: '.$ex->getMessage());
throw new \CRM_Civiconfig_EntityException('Could not find an option group with name '.$optionGroupName
.', contact your system administrator. Error from API OptionGroup.Getvalue: '.$ex->getMessage() . '.');
}
return $valueList;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment