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