From 42c0daeebd3033f9431414fbb340b14fdd0b5b9e Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 18 Mar 2014 17:37:34 -0700 Subject: [PATCH] Error handling - Remove old, unsafe functions --- CRM/Core/Error.php | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/CRM/Core/Error.php b/CRM/Core/Error.php index 93fcc5bb17..55e2cbeaf0 100644 --- a/CRM/Core/Error.php +++ b/CRM/Core/Error.php @@ -791,28 +791,20 @@ class CRM_Core_Error extends PEAR_ErrorStack { } /** - * @deprecated - * @see CRM_Core_TemporaryErrorScope::ignoreException + * PEAR error-handler which converts errors to exceptions + * + * @param $pearError + * @throws PEAR_Exception */ - public static function ignoreException($callback = NULL) { - if (!$callback) { - $callback = array('CRM_Core_Error', 'nullHandler'); - } - - $GLOBALS['_PEAR_default_error_mode'] = PEAR_ERROR_CALLBACK; - $GLOBALS['_PEAR_default_error_options'] = $callback; - } - public static function exceptionHandler($pearError) { CRM_Core_Error::backtrace('backTrace', TRUE); throw new PEAR_Exception($pearError->getMessage(), $pearError); } /** - * Error handler to quietly catch otherwise fatal smtp transport errors. + * PEAR error-handler to quietly catch otherwise fatal errors. Intended for use with smtp transport. * * @param object $obj The PEAR_ERROR object - * * @return object $obj * @access public * @static @@ -823,23 +815,6 @@ class CRM_Core_Error extends PEAR_ErrorStack { return $obj; } - /** - * (Re)set the default callback method - * - * @return void - * @access public - * @deprecated - * @see CRM_Core_TemporaryErrorScope::ignoreExxception - * @static - */ - public static function setCallback($callback = NULL) { - if (!$callback) { - $callback = array('CRM_Core_Error', 'handle'); - } - $GLOBALS['_PEAR_default_error_mode'] = PEAR_ERROR_CALLBACK; - $GLOBALS['_PEAR_default_error_options'] = $callback; - } - /* * @deprecated * This function is no longer used by v3 api. -- 2.25.1