Hello everybody I have a problem with exception.
The following code block do this result:
Fatal error: Uncaught exception 'Doctrine\DBAL\Types\ConversionException' with message 'Could not convert database value .....
Code:
foreach ($result as $indexArray => $objectID) {
try {
$tempObject = new OggettoEbayDB();
$tempObject = $entityManager->find('OggettoEbayDB',$objectID);
if($tempObject->checkValid()){
//.... do something else
}
} catch(Doctrine\DBAL\Types\ConversionException $e){
$arrayOggettoEbayDBDeleted [] = '<b>Oggetto con id -> '.$tempObject->getId().' ha dato problemi con il seguente messaggio '.$e->getMessage().'<br/><br/>';
}
}
I need as may be obvious to catch the object with the error first but continue the foreach on other object later
I am anyway not able to go in the catch block, the exception is always catched as ” uncaught “
have I to specify the correct type or what?
Thanks anybuddy!
This is likely due to namespace resolution rules.
When you’re not in the Doctrine namespace itself, you should make the exception class absolute by prefixing it with a backslash: