/** * Try to export and catch ExportFailedException. * * @param $intConfig * @param $arrIds */ public function exportAndCatchExceptions($intConfig, $arrIds) { try { \Leads\Leads::export($intConfig, $arrIds); } catch (\Leads\Exporter\ExportFailedException $e) { \Message::addError($e->getMessage()); \Controller::redirect(\System::getReferer()); } }