Bug #2244
Exception is not catchable. Exception is still shown after throwStatus
100%
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?
Updated by Karsten Dambekalns almost 12 years ago
- Status changed from New to Needs Feedback
- Assignee set to Karsten Dambekalns
Works for me with the current FLOW3, i.e. throwStatus() masks an exception in development and production context. Is this still an issue?
Updated by Karsten Dambekalns almost 12 years ago
internal note: "soweit ich noch weiß ist die sache die: das der catch block mit F3::PHPCR::NodeType::NoSuchNodeTypeException $e nicht funktionierte. es ging nicht um throwStatus. es war einfach nicht möglich die exception abzufangen."
Updated by Christoph Blömer almost 12 years ago
I can not reproduce it. I think the problem is gone. Maybe I should have asked for ::F3::PHPCR::NodeType::NoSuchNodeTypeException.
This was in Beta 1 or 2 and now the namespace syntax has changed and you have to ask for \F3\PHPCR\NodeType\NoSuchNodeTypeException.
I would say this bug is resolved.
Updated by Karsten Dambekalns almost 12 years ago
- Status changed from Needs Feedback to Closed
- % Done changed from 0 to 100
Closed as 'no change required'