CRM_Core_Error
class CRM_Core_Error extends PEAR_ErrorStack
Class CRM_Core_Error
Constants
FATAL_ERROR |
Status code of various types of errors. |
DUPLICATE_CONTACT |
|
DUPLICATE_CONTRIBUTION |
|
DUPLICATE_PARTICIPANT |
|
Properties
static | $modeException | If modeException == true, errors are raised as exception instead of returning civicrm_errors |
Methods
Singleton function used to manage this object.
Constructor.
No description
Status display function specific to payment processor errors.
Create the main callback method. this method centralizes error processing.
this function is used to trap and print errors during system initialization time. Hence the error message is quite ugly
this function is used to return error details
Handle errors raised using the PEAR Error Stack.
Display an error page with an error message describing what happened.
Display an error page with an error message describing what happened.
Outputs pre-formatted debug information. Flushes the buffers so we can interrupt a potential POST/redirect
Similar to the function debug. Only difference is in the formatting of the output.
Display the error message on terminal and append it to the log file.
Append to the query log (if enabled)
Execute a query and log the results.
Obtain a reference to the error log.
Generate the name of the logfile to use and store it as a static.
No description
Render a backtrace array as a string.
Render a backtrace array as an array.
Render an exception as HTML string.
Write details of an exception to the log.
No description
Set a status message in the session, then bounce back to the referrer.
Reset the error stack.
PEAR error-handler which converts errors to exceptions
PEAR error-handler to quietly catch otherwise fatal errors. Intended for use with smtp transport.
No description
Terminate execution abnormally.
No description
Details
at line 111
static object
singleton(null $package = NULL, bool $msgCallback = FALSE, bool $contextCallback = FALSE, bool $throwPEAR_Error = FALSE, string $stackClass = 'PEAR_ErrorStack')
Singleton function used to manage this object.
at line 121
__construct()
Constructor.
at line 142
static array|null|string
getMessages($error, string $separator = '<br />')
at line 160
static
displaySessionError($error, string $separator = '<br />')
Status display function specific to payment processor errors.
at line 177
static
handle(object $pearError)
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.
at line 254
static
simpleHandler($pearError)
this function is used to trap and print errors during system initialization time. Hence the error message is quite ugly
at line 275
static array
getErrorDetails($pearError)
this function is used to return error details
at line 306
static int
handlePES(mixed $pearError)
Handle errors raised using the PEAR Error Stack.
currently the handler just requests the PES framework to push the error to the stack (return value PEAR_ERRORSTACK_PUSH).
Note: we can do our own error handling here and return PEAR_ERRORSTACK_IGNORE.
Also, if we do not return any value the PEAR_ErrorStack::push() then does the action of PEAR_ERRORSTACK_PUSHANDLOG which displays the errors on the screen, since the logger set for this error stack is 'display' - see CRM_Core_Config::getLog();
at line 327
static
fatal(string $message = NULL, string $code = NULL, string $email = NULL)
deprecated
deprecated
Display an error page with an error message describing what happened.
at line 411
static
handleUnhandledException(Exception $exception)
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 something that follows a cleaner separation of concerns.
at line 493
static string
debug(string $name, $variable = NULL, bool $log = TRUE, bool $html = TRUE, bool $checkPermission = TRUE)
Outputs pre-formatted debug information. Flushes the buffers so we can interrupt a potential POST/redirect
at line 547
static string
debug_var(string $variable_name, mixed $variable, bool $print = TRUE, bool $log = TRUE, string $prefix = '')
Similar to the function debug. Only difference is in the formatting of the output.
at line 590
static string
debug_log_message(string $message, bool $out = FALSE, string $prefix = '', string $priority = NULL)
Display the error message on terminal and append it to the log file.
Provided the user has the 'view debug output' the output should be displayed. In all cases it should be logged.
at line 625
static
debug_query(string $string)
Append to the query log (if enabled)
at line 641
static
debug_query_result(string $query)
Execute a query and log the results.
at line 653
static Log
createDebugLogger(string $prefix = '')
Obtain a reference to the error log.
at line 667
static string
generateLogFileHash(CRM_Core_Config $config)
Generate a hash for the logfile.
CRM-13640.
at line 687
static protected
generateLogFileName(string $prefix)
Generate the name of the logfile to use and store it as a static.
This function includes poor man's log file management and a check as to whether the file exists.
at line 719
static
backtrace(string $msg = 'backTrace', bool $log = FALSE)
at line 742
static string
formatBacktrace(array $backTrace, bool $showArgs = TRUE, int $maxArgLen = 80)
Render a backtrace array as a string.
at line 764
static array
parseBacktrace(array $backTrace, bool $showArgs = TRUE, int $maxArgLen = 80)
Render a backtrace array as an array.
at line 836
static string
formatHtmlException( $e)
Render an exception as HTML string.
at line 872
static string
formatTextException( $e)
Write details of an exception to the log.
at line 896
static object
createError($message, int $code = 8000, string $level = 'Fatal', array $params = NULL)
at line 911
static
statusBounce(string $status, null $redirect = NULL, string $title = NULL)
Set a status message in the session, then bounce back to the referrer.
at line 930
static
reset()
Reset the error stack.
at line 942
static
exceptionHandler($pearError)
PEAR error-handler which converts errors to exceptions
at line 956
static object
nullHandler(object $obj)
PEAR error-handler to quietly catch otherwise fatal errors. Intended for use with smtp transport.
at line 973
static array
createAPIError($msg, null $data = NULL)
deprecated
deprecated
at line 991
static
movedSiteError($file)
at line 1006
static protected
abend(string $code)
Terminate execution abnormally.