class CRM_Queue_ErrorPolicy

To ensure that PHP errors or unhandled exceptions are reported in JSON format, wrap this around your code. For example:

Properties

$active

Methods

__construct(null|int $level = NULL)

No description

activate()

Enable the error policy.

deactivate()

Disable the error policy.

mixed
call(callable|array|string $callable)

Execute the callable. Activate and deactivate the error policy automatically.

bool
onError(string $errno, string $errstr, string $errfile, int $errline)

Receive (semi) recoverable error notices.

onShutdown()

Receive non-recoverable error notices

reportError(array $error)

Print a fatal error.

reportException( $e)

Print an unhandled exception.

Details

at line 51
__construct(null|int $level = NULL)

Parameters

null|int $level PHP error level to capture (e.g. E_PARSE|E_USER_ERROR).

at line 62
activate()

Enable the error policy.

at line 81
deactivate()

Disable the error policy.

at line 103
mixed call(callable|array|string $callable)

Execute the callable. Activate and deactivate the error policy automatically.

Parameters

callable|array|string $callable A callback function.

Return Value

mixed

at line 128
bool onError(string $errno, string $errstr, string $errfile, int $errline)

Receive (semi) recoverable error notices.

Parameters

string $errno
string $errstr
string $errfile
int $errline

Return Value

bool

Exceptions

Exception

See also

set_error_handler

at line 141
onShutdown()

Receive non-recoverable error notices

See also

register_shutdown_function
error_get_last

at line 157
reportError(array $error)

Print a fatal error.

Parameters

array $error The PHP error (with "type", "message", etc).

at line 178
reportException( $e)

Print an unhandled exception.

Parameters

$e The unhandled exception.