private function validateAndRun($type) { if ($this->form->validate()) { try { $this->task->run(); } catch (Gpf_Tasks_LongTaskInterrupt $e) { $this->form->setField(self::SUCCESS, Gpf::NO); $this->form->setInfoMessage($e->getMessage()); return; } catch (Exception $e) { $this->task->forceFinishTask(); $this->form->setField(self::SUCCESS, Gpf::YES); $this->form->setErrorMessage($this->_('Error during ' . $this->getActionName($type) . ' coupons') . ' (' . $e->getMessage() . ') '); return; } $this->form->setInfoMessage($this->_('Coupons are successfully ' . $this->getActionName($type, true))); $this->form->setField(self::SUCCESS, Gpf::YES); } }