How to stop execution of an action?

0 views
Skip to first unread message

k00ni

unread,
Jun 27, 2009, 7:55:09 AM6/27/09
to OntoWiki User Discussion
Hi,

we have an action for example .../syncml/sync. This action has
different checking-function. If one function detects problems than the
action execution must be stopping. How can we do this?

Is an exit ok?


Greetings

Sebastian Dietzold

unread,
Jun 27, 2009, 8:14:41 AM6/27/09
to OntoWiki User Discussion
quote k00ni (27.6.2009):

yes, but please throw an exception before that.

examples are e.g. in the serviceController at transitiveclosureAction()
...

// fetch start resource parameter
if (isset($this->_request->sr)) {
$resource = $this->_request->getParam('sr', null, true);
} else {
require_once 'OntoWiki/Exception.php';
throw new OntoWiki_Exception('Missing parameter sr (start resource)!');
exit;
}

regards

SD

--
Sebastian Dietzold - Department of Computer Science; University of Leipzig
Tel/Fax: +49 341 97 323-66/-29 http://bis.uni-leipzig.de/SebastianDietzold

Reply all
Reply to author
Forward
0 new messages