ckrudelux Posted March 12, 2020 Share Posted March 12, 2020 Should it matter from there I catch an exception? This works and catches the PDO exception from users $dice = new Dice(); try { $dice->create('Controller'); }catch(Exception $e){ } Try to catch the exception in the controller wont work class Controller { public function __construct(Users $users){ try{ $users->create('username','password'); }catch(Exception $e){ } } } Link to comment Share on other sites More sharing options...
ckrudelux Posted March 12, 2020 Author Share Posted March 12, 2020 To answer my own question remember the namespace. This will make things work much smoother Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now