Zend - unable to catch exception [closed]
- by coder3
This still throw an uncaught exception.. Any insight why this isn't working?
 protected function login()
        {
        $cart = $this->getHelper('GetCurrentCart');
        $returnValue = false;
        if ($this->view->form->isValid($this->_getAllParams())) {
        $values = $this->view->form->getValues();
        try {
        $this->goreg = $this->goregFactory->create($this->config->goreg->service_url);
        if ($this->goreg->login($values['username'], $values['password'])
                        && $this->goregSession->isLoggedIn()) {
            $returnValue = true;
        } else {
            echo 'success 1';
        }
        }
        catch (Exception $e) {
    echo 'error 1';
        }
         catch (Zend_Exception $e) {
             echo 'error 2';
        }
        catch (Zend_Http_Client_Exception $e) {
             echo 'error 3';
        }
    }
    return $returnValue;
}