Documentation

CApplicationException Constructor

CApplicationException(
 string msg,
 mixed id = false
)

The method creates an instance of CApplicationException class with the msg text with id. Non-static method.

Constructor parameters

ParameterDescription
msg Error text.
id The error ID.

Note

To raise exceptions it is recommended to call $APPLICATION->$APPLICATION->ThrowException method directly. This constructor is mainly intended as the template for the custom exception classes inherited from CApplicationException.

See Also

Examples of use

<?
$exception = new CApplicationException("File is not found", BX_E_FILE_NOT_FOUND);
$APPLICATION->ThrowException($exception); 
?>


© «Bitrix24», 2001-2024