Bug #2244

Exception is not catchable. Exception is still shown after throwStatus

Added by Christoph Blömer about 13 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Should have
Category:
Error
Target version:
-
Start date:
2008-11-29
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

Description

If I excecute the following code in FLOW3 a F3::PHPCR::NodeType::NoSuchNodeTypeException is thrown:

$taskManagement1 = $this->objectFactory->create('F3::TaskManagement::Domain::TaskManagement');
$taskManagement1->setName('TheTaskManagement');
$this->taskManagementRepository->add($taskManagement1);

Then I tried to catch the Exception which is thrown and throw a status.

try {
$taskManagement1 = $this->objectFactory->create('F3::TaskManagement::Domain::TaskManagement');
$taskManagement1->setName('TheTaskManagement');
$this->taskManagementRepository->add($taskManagement1);
} catch(F3::PHPCR::NodeType::NoSuchNodeTypeException $e) {
$this->throwStatus(500);
}

Result: This does not work and no "500 Internal Server Error" is shown. Only the Exception itself.

After that I added the throwStatus(500) outside the catch-block to check if that works.
Result:The Status "500 Internal Server Error" is shown but also the exception appears.
Is this the correct behavier, that the exception is still shown after throwing the status?

Also available in: Atom PDF