[TYPO3-mvc] Re: Extbase and exceptions

devweb dev-si at cndp.fr
Thu Dec 8 11:00:59 CET 2016


I have the same problem (typo3 6.2.29).
If throw is in the same class than try{} catch{} then all works but if throw i s in an other class that's not work. typo3 show me the page with his message "Uncaught TYPO3 Exception" 

an exemple ;

class Foo {
    protected function testException() {
        throw new \Exception('testException works?');
    }

   public function bar() {
      try {
            $this->testException();
        } catch (\Exception $ex) {
            echo($ex->getMessage()); // this is ok 
        }    

       $otherClass = new otherClass();
       try {
            $otherClass->testException();
        } catch (\Exception $ex) {
            echo($ex->getMessage()); // this is not ok, typo3 error handler stop before this...
        } 
   }
}


More information about the TYPO3-project-typo3v4mvc mailing list