Fix exception thrown to std CRM_Core_Exception
authoreileen <emcnaughton@wikimedia.org>
Mon, 4 Nov 2019 00:59:26 +0000 (13:59 +1300)
committereileen <emcnaughton@wikimedia.org>
Mon, 4 Nov 2019 00:59:26 +0000 (13:59 +1300)
CRM/Core/BAO/CustomField.php

index 2f7910611b0e085e5f32886133f4111156367b8a..6c4a78191e3d1102539c83ad9dd34a8a4b9c8aaa 100644 (file)
@@ -1064,14 +1064,15 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
    * @param int $entityId
    *
    * @return string
-   * @throws \Exception
+   *
+   * @throws \CRM_Core_Exception
    */
   public static function displayValue($value, $field, $entityId = NULL) {
     $field = is_array($field) ? $field['id'] : $field;
     $fieldId = is_object($field) ? $field->id : (int) str_replace('custom_', '', $field);
 
     if (!$fieldId) {
-      throw new Exception('CRM_Core_BAO_CustomField::displayValue requires a field id');
+      throw new CRM_Core_Exception('CRM_Core_BAO_CustomField::displayValue requires a field id');
     }
 
     if (!is_a($field, 'CRM_Core_BAO_CustomField')) {