Zend Framework Eylem benim kendi Model İstisnalar yakalamak için nasıl

0 Cevap php

Ben bir XMLDocument_Exception atar bir modeli var. Benim denetleyicisi eylem ben yakalanmadan değil nedense ama bu istisna atabilir bir try catch bloğu eklemek istiyorum.

public function listissuesAction() {
    $publicationPid  = $this->_request->get('publicationPid');
    $this->getFrontController()->throwExceptions(true);
    try {
        $fedoraPublication = new FedoraMETSPublication($publicationPid);
    } catch (XMLDocument_Exception $e) {
        return $this->_forward('content/unavailable');
    }
}

ve modeli şöyle istisna atıyor:

if ($mets) {
    $this->loadXML($mets);
} else {
    throw new XMLDocument_Exception('Failed to load METS Document from SOAP Server');
}   

FedoraMETSPublication XMLDocument uzanır FedoraMETS uzanır. Yukarıdaki kod FedoraMETS en yapıcı kurucudaki olduğunu.

Ben şu hatayı görüyorum:

Fatal error:  Uncaught exception 'XMLDocument_Exception' with message 'Failed to load METS Document from SOAP Server' in    2 /Users/dof/Sites/ccymod/trunk/application/models/Fedora/METS.php:21
Stack trace:
#0 /Users/dof/Sites/ccymod/trunk/application/models/Fedora/METS/Issue.php(16): FedoraMETS->__construct('llgc-id:1183037')
#1 /Users/dof/Sites/ccymod/trunk/application/models/Fedora/METS/Publication.php(44): FedoraMETSIssue->__construct('llgc-id:1183037')
#2 /Users/dof/Sites/ccymod/trunk/application/views/scripts/browse/listissues.phtml(19): FedoraMETSPublication->getIssues()
#3 /Users/dof/Sites/ccymod/trunk/lib/Zend/View.php(108): include('/Users/dof/Site...')
#4 /Users/dof/Sites/ccymod/trunk/lib/Zend/View/Abstract.php(831): Zend_View->_run('/Users/dof/Site...')
#5 /Users/dof/Sites/ccymod/trunk/lib/Zend/Controller/Action/Helper/ViewRenderer.php(903): Zend_View_Abstract->render('browse/listissu...')
#6 /Users/dof/Sites/ccymod/trunk/lib/Zend/Controller/Action/Helper/ViewRenderer.php(924): Zend_Controller_Action_Helper_ViewRend in /Users/dof/Sites/ccymod/trunk/application/models/Fedora/METS.php on line 21

Neden Eylem Kontrolörü Bu durum alıcı değilim?

0 Cevap