class CRM_Core_Error extends PEAR_ErrorStack {
/**
- * status code of various types of errors
+ * Status code of various types of errors
* @var const
*/
CONST FATAL_ERROR = 2;
public static $modeException = NULL;
/**
- * singleton function used to manage this object.
+ * Singleton function used to manage this object.
*
* @param null $package
* @param bool $msgCallback
}
/**
- * constructor
+ * Constructor
*/
function __construct() {
parent::__construct('CiviCRM');
}
/**
- * create the main callback method. this method centralizes error processing.
+ * Create the main callback method. this method centralizes error processing.
*
* the errors we expect are from the pear modules DB, DB_DataObject
* which currently use PEAR::raiseError to notify of error messages.
}
/**
- * display an error page with an error message describing what happened
+ * Display an error page with an error message describing what happened
*
* @param string $message the error message
* @param string $code the error code if any
}
}
+ if ($config->backtrace) {
+ self::backtrace();
+ }
+
+ CRM_Core_Error::debug_var('Fatal Error Details', $vars);
+ CRM_Core_Error::backtrace('backTrace', TRUE);
+
// If we are in an ajax callback, format output appropriately
if (CRM_Utils_Array::value('snippet', $_REQUEST) === CRM_Core_Smarty::PRINT_JSON) {
$out = array(
CRM_Core_Page_AJAX::returnJsonResponse($out);
}
- if ($config->backtrace) {
- self::backtrace();
- }
-
$template = CRM_Core_Smarty::singleton();
$template->assign($vars);
- CRM_Core_Error::debug_var('Fatal Error Details', $vars);
- CRM_Core_Error::backtrace('backTrace', TRUE);
$config->userSystem->outputError($template->fetch($config->fatalErrorTemplate));
self::abend(CRM_Core_Error::FATAL_ERROR);
}
/**
- * display an error page with an error message describing what happened
+ * Display an error page with an error message describing what happened
*
* This function is evil -- it largely replicates fatal(). Hopefully the
* entire CRM_Core_Error system can be hollowed out and replaced with
}
/**
- * outputs pre-formatted debug information. Flushes the buffers
+ * Outputs pre-formatted debug information. Flushes the buffers
* so we can interrupt a potential POST/redirect
*
* @param string name of debug section
}
/**
- * display the error message on terminal
+ * Display the error message on terminal
*
* @param $message
* @param bool $out should we log or return the output
* @param $message
* @param int $code
* @param string $level
- * @param null $params
+ * @param array $params
*
* @return object
*/
}
/**
- * reset the error stack
+ * Reset the error stack
*
* @access public
* @static