Custom PHP exception handling
August 23, 2010 • PHP, Programming • Comments
A large project I’ve been working on as of late has many moving parts. It allowed a lot of dynamic edits that utilized AJAX for sending dynamic information to and from a database. When errors occurred it was alright for me, because I could debug them however what it came the client… Well let’s just say they were convinced that with these errors their computer was going to spontaneous combust.
I’ll admit it now that I was a little lazy when developing some of the classes. I went back and modified them so that they would implement exception handling, only I went one step further and used custom exception handling so that I could log any errors that may occur.
Within this posting, im going to create a class that will have errors, and I’ll also create a custom exception class that will catch any of these errors and log them to a file
