I'm developing some lower end code in my system that uses multiple child classes of the php exception class. Essentially I have the exceptions broken up to a few categories. What I'm wanting to do is two things.
- I need all exceptions that are fired in the application to be handled in a single place.
- I need to be able to log and then handle/generate the view for the user to receive feedback on the apps. error.
What I'm wondering is should I have some sort of try/catch encapsulating the application? I don't like that idea at all, it sounds like a very crappy implementation. I also don't like the idea of set_exception_handler unless i can sett the function to be a method of an object. The reason for this is that if I designate a function to handle the exceptions this will be the first function in the application. Everything else is a method of an object.
Hopefully I've provided enough details about the scenario. I'm trying to keep this clean and follow best practices. This code will be going OSS so I don't feel like writing it 10 times :)