Handle the failure case on Doctrine ORM