title: CodeIgniter and throwing exceptions
body: <p>I recently handed in a project for school which I built in CodeIgniter. I had to present it to my teacher and when asked how I handled certain errors, he told me to throw exceptions to intercept things a lot earlier in the chain of events.</p>
  
  <p>I have learnt how to throw exceptions and how to use <code>try...catch</code> blocks to uh, catch and handle them but somehow, when I started using CodeIgniter, I forgot all about them and didn't really use exceptions anymore. </p>
  
  <p>Instead, I just handled my errors 'manually', for lack of a better word: I'd use <code>TRUE</code>and <code>FALSE</code> boolean values to check if, for example, a query executed properly, and I would use the returned boolean to handle the result of the query. If <code>TRUE</code>, I'd go ahead and do my stuff, if <code>FALSE</code> I'd 'manually' throw an error message. The project was very AJAX-dependent and the error messages would pop up in quite a fancy way, dropping down from the top of the page; not sure if this is possible when I throw an exception with <code>throw new Exception</code>? I know that this basically stops the code from executing when the exception is thrown, so wouldn't that break things somehow?</p>
  
  <p>I also seem to remember reading somewhere that throwing exceptions isn't the best practice ever but I can't find the source of this anymore and I'm not quite sure if this is the case; after all, we did learn how to use them in class and I like to believe we learn best practices there, haha.</p>
  
  <p>If necessary, I could go back and try to find the piece of code where he pointed out that I should've thrown an exception. However, for now, I'm just wondering whether or not I should use exceptions in my code or handle things manually. What are the best practices regarding this?</p>
  
  <p>Thanks.</p>