Interface: IErrorHandler

Interface for error handling.

Extends

Known implementations

Authors

Oleg Schildt

Package

Source code

 

Methods
public

Disables the trace.

public

Enables the trace.

public

Returns the last error.

public

This is the function for handling of the PHP errors. It is set in the error handler.

public

This is the function for handling of the PHP exceptions. It should be called in the catch block to trace detailed information if an exception is thrown.

public

Initializes the error handler with parameters.

public

Stores the last error.

public

Returns the state whether the trace is active or not.


Method: IErrorHandler::disableTrace()

public function disableTrace(): void;

Disables the trace.

Details

If the trace is active, any eror, warning or notice is traced to the standard file.

Returns

void

Authors

Oleg Schildt

Source code

See also


Method: IErrorHandler::enableTrace()

public function enableTrace(): void;

Enables the trace.

Details

If the trace is active, any error, warning or notice is traced to the standard file.

Returns

void

Authors

Oleg Schildt

Source code

See also


Method: IErrorHandler::getLastError()

public function getLastError(): string;

Returns the last error.

Returns

string

Returns the last error or an empty string if no error occurred so far.

Authors

Oleg Schildt

Source code


Method: IErrorHandler::handleError()

public function handleError(int $errno, string $errstr, string $errfile, int $errline): void;

This is the function for handling of the PHP errors. It is set in the error handler.

Parameters

Name Pass type Value type Default value Description
$errno by value int

Error code.

$errstr by value string

Error text.

$errfile by value string

Source file where the error occurred.

$errline by value int

Line number where the error occurred.

Returns

void

Authors

Oleg Schildt

Source code


Method: IErrorHandler::handleException()

public function handleException(\Throwable $ex, int $errno): void;

This is the function for handling of the PHP exceptions. It should be called in the catch block to trace detailed information if an exception is thrown.

Parameters

Name Pass type Value type Default value Description
$ex by value \Throwable

Thrown exception.

$errno by value int

Error code.

Returns

void

Authors

Oleg Schildt

Source code


Method: IErrorHandler::init()

public function init(array $parameters): void;

Initializes the error handler with parameters.

Parameters

Name Pass type Value type Default value Description
$parameters by value array

The parameters may vary for each error handler.

Returns

void

Throws

\Exception

It might throw an exception in the case of any system errors.

Overrides

Authors

Oleg Schildt

Source code


Method: IErrorHandler::setLastError()

public function setLastError(string $error): void;

Stores the last error.

Parameters

Name Pass type Value type Default value Description
$error by value string

The error text to be stored.

Returns

void

Authors

Oleg Schildt

Source code


Method: IErrorHandler::traceActive()

public function traceActive(): bool;

Returns the state whether the trace is active or not.

Details

If the trace is active, any error, warning or notice is traced to the standard file.

Returns

bool

Returns the state whether the trace is active or not.

Authors

Oleg Schildt

Source code

See also