Documentation

ThrowException

CMain::ThrowException(
 mixed msg,
 mixed id = false
)

The method throws an msg with the specified id. You can obtain the last exception by calling $APPLICATION->GetException() method. Non-static method.

Parameters

ParameterDescription
msg Error description or an instance of class inherited from CApplicationException method.
id Error ID.

See Also

Examples of use

<?
if($login=='')
{
   global $APPLICATION;
   $APPLICATION->ThrowException('Login must not be empty.'); 
   return false;
}
?>
  


© «Bitrix24», 2001-2022
Up