From: Seamus Lee Date: Fri, 25 Oct 2019 22:26:27 +0000 (+1100) Subject: [REF] Remove CRM_Exception in favor of CRM_Core_Exception X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ff48e5732908f69692460d05b75fde175127edca;p=civicrm-core.git [REF] Remove CRM_Exception in favor of CRM_Core_Exception --- diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index d1b7668fee..cadce9c18c 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -1858,7 +1858,7 @@ SELECT contact_id /** * Drop all CiviCRM tables. * - * @throws \CRM_Exception + * @throws \CRM_Core_Exception */ public static function dropAllTables() { diff --git a/CRM/Core/Error.php b/CRM/Core/Error.php index e52e51515a..2bf7ba92e0 100644 --- a/CRM/Core/Error.php +++ b/CRM/Core/Error.php @@ -39,34 +39,6 @@ require_once 'CRM/Core/Exception.php'; require_once 'Log.php'; -/** - * Class CRM_Exception - */ -class CRM_Exception extends PEAR_Exception { - - /** - * Redefine the exception so message isn't optional. - * - * Supported signatures: - * - PEAR_Exception(string $message); - * - PEAR_Exception(string $message, int $code); - * - PEAR_Exception(string $message, Exception $cause); - * - PEAR_Exception(string $message, Exception $cause, int $code); - * - PEAR_Exception(string $message, PEAR_Error $cause); - * - PEAR_Exception(string $message, PEAR_Error $cause, int $code); - * - PEAR_Exception(string $message, array $causes); - * - PEAR_Exception(string $message, array $causes, int $code); - * - * @param string $message exception message - * @param int $code - * @param Exception $previous - */ - public function __construct($message = NULL, $code = 0, Exception $previous = NULL) { - parent::__construct($message, $code, $previous); - } - -} - /** * Class CRM_Core_Error */ diff --git a/CRM/Utils/File.php b/CRM/Utils/File.php index 000d9505d4..aa65b1d181 100644 --- a/CRM/Utils/File.php +++ b/CRM/Utils/File.php @@ -320,7 +320,7 @@ class CRM_Utils_File { if (FALSE === file_get_contents($fileName)) { // Our file cannot be found. // Using 'die' here breaks this on extension upgrade. - throw new CRM_Exception('Could not find the SQL file.'); + throw new CRM_Core_Exception('Could not find the SQL file.'); } self::runSqlQuery($dsn, file_get_contents($fileName), $prefix, $dieOnErrors); diff --git a/tests/phpunit/api/v3/APITest.php b/tests/phpunit/api/v3/APITest.php index 9bc6c00878..30d565f73b 100644 --- a/tests/phpunit/api/v3/APITest.php +++ b/tests/phpunit/api/v3/APITest.php @@ -143,7 +143,7 @@ class api_v3_APITest extends CiviUnitTestCase { try { $result = civicrm_api3('contact', 'get', []); } - catch (CRM_Exception $e) { + catch (CRM_Core_Exception $e) { $this->fail("This should have been a success test"); } $this->assertTrue(is_array($result));