8.4.2 How to catch Doctrine exception in single page controller
Permalink
A single page controller's
catches php post errors.
How can I catch DB exceptions thrown by Doctrine? For example I have a unique key:
when I save the same uid it throws a DB exception. How can I catch it in the controller?
public function validate($args)
catches php post errors.
How can I catch DB exceptions thrown by Doctrine? For example I have a unique key:
/** * @ORM\Column(type="string",unique=true) */ protected $uid;
when I save the same uid it throws a DB exception. How can I catch it in the controller?