Bitrix Site Manager

CMain::ThrowException

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

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

Parameters

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

See Also

Example


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