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:
-
Bitrix\Main\SystemException
- base class for all system exceptions-
Bitrix\Main\IO\IoException - base class for all file input/output
- Bitrix\Main\IO\FileDeleteException - exception when deleting file
- Bitrix\Main\IO\FileNotFoundException - required file is missing
- Bitrix\Main\IO\FileOpenException - exception when opening a file
- Bitrix\Main\IO\InvalidPathException - incorrect path
- Bitrix\Main\IO\FileNotOpenedException - file is not opened
- Bitrix\Main\Config\ConfigurationException - error in configuration
-
Bitrix\Main\Security\SecurityException
- security error- \Bitrix\Main\Security\Sign\BadSignatureException - signature error exception.
- Bitrix\Main\ArgumentException - base class for exceptions, associated with incoming method parameters
- Bitrix\Main\ArgumentNullException - parameter should not be empty
- Bitrix\Main\ArgumentOutOfRangeException - parameter outside accessible range
- Bitrix\Main\ArgumentTypeException - parameter of incorrect type
- Bitrix\Main\DB\Exception - base class for database exceptions
-
Bitrix\Main\DB\ConnectionException
- exception during connection - Bitrix\Main\DB\SqlException - exception when executing a query
-
- Bitrix\Main\NotSupportedException - thrown when feature is not supported
- Bitrix\Main\NotImplementedException - thrown when feature is supported, but implemented yet
- Bitrix\Main\AccessDeniedException - thrown when access is denied
-
Bitrix\Main\IO\IoException - base class for all file input/output
- \Bitrix\Main\ObjectPropertyException - thrown when object properties are invalid.
- \Bitrix\Main\ObjectNotFoundException - throws exception when object does not exist.
- \Bitrix\Main\ObjectException - exception is thrown when object cannot be created.
-
Bitrix\Main\LoaderException
- exception in loader
© «Bitrix24», 2001-2024