Documentation

SystemException

SystemException base class for all exceptions in the system.

D7 core processes errors using the mechanism of exceptions fully similar to the mechanism of php exceptions. When error occurs - an exception is thrown. When error must be processed - exception must be caught.

Similar tools in the old core:

Method Description Available from version
construct creates new exception object.
  • Exceptions in the Bitrix Framework learning course

Examples

// D7
use Bitrix\Main\SystemException;

try
{
    // ...
    throw new SystemException("Error");
}
catch (SystemException $exception)
{
    echo $exception->getMessage();
} 

Exception hierarchy in D7:



© «Bitrix24», 2001-2024
Up