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 bool | $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.
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
Output a deprecated function warning to log file. Deprecated class:function is automatically generated from calling function.
Details
at line 85
static CRM_Core_Error
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 95
__construct()
Constructor.
at line 116
static array|null|string
getMessages($error, string $separator = '<br />')
at line 137
static
displaySessionError($error, string $separator = '<br />')
Status display function specific to payment processor errors.
at line 154
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 233
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 254
static array
getErrorDetails($pearError)
this function is used to return error details
at line 285
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 306
static
fatal(string $message = NULL, string $code = NULL, string $email = NULL)
deprecated
deprecated This is a really annoying function. We ❤ exceptions. Be exceptional!
Display an error page with an error message describing what happened.
at line 390
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 467
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 523
static string
debug_var(string $variable_name, mixed $variable, bool $print = TRUE, bool $log = TRUE, string $prefix = '', int $priority = NULL)
Similar to the function debug. Only difference is in the formatting of the output.
at line 566
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 601
static
debug_query(string $string)
Append to the query log (if enabled)
at line 617
static
debug_query_result(string $query)
Execute a query and log the results.
at line 629
static Log
createDebugLogger(string $prefix = '')
Obtain a reference to the error log.
at line 643
static string
generateLogFileHash(CRM_Core_Config $config)
Generate a hash for the logfile.
CRM-13640.
at line 664
static protected
generateLogFileName(string $prefix)
Generate the name of the logfile to use and store it as a static.
This function includes simplistic log rotation and a check as to whether the file exists.
at line 696
static
backtrace(string $msg = 'backTrace', bool $log = FALSE)
at line 719
static string
formatBacktrace(array $backTrace, bool $showArgs = TRUE, int $maxArgLen = 80)
Render a backtrace array as a string.
at line 741
static array
parseBacktrace(array $backTrace, bool $showArgs = TRUE, int $maxArgLen = 80)
Render a backtrace array as an array.
at line 813
static string
formatHtmlException(Exception $e)
Render an exception as HTML string.
at line 849
static string
formatTextException(Exception $e)
Write details of an exception to the log.
at line 873
static object
createError($message, int $code = 8000, string $level = 'Fatal', array $params = NULL)
at line 888
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 907
static
reset()
Reset the error stack.
at line 919
static
exceptionHandler($pearError)
PEAR error-handler which converts errors to exceptions
at line 933
static object
nullHandler(object $obj)
PEAR error-handler to quietly catch otherwise fatal errors. Intended for use with smtp transport.
at line 950
static array
createAPIError($msg, null $data = NULL)
deprecated
deprecated This function is no longer used by v3 api.
at line 968
static
movedSiteError($file)
at line 983
static protected
abend(string $code)
Terminate execution abnormally.
at line 996
static bool
isAPIError(array $error, int $type = CRM_Core_Error::FATAL_ERROR)
at line 1012
static
deprecatedFunctionWarning($newMethod)
Output a deprecated function warning to log file. Deprecated class:function is automatically generated from calling function.