I am writing a user-defined PHP exception handler for my application and would like it to handle different kinds of Exceptions in different ways.
For example if the application throws an uncaught PDOException my handler would send me an email but if an uncaught Exception is thrown another action would be performed.
Currently the handler looks like this:
function exception_handler($po_exception) {
// If this is a PDO Exception send an email.
example_email_function('There was a database problem', $po_exception->getMessage());
// If this is any other type of Exception, let the user know something has gone wrong.
echo "Something went wrong.\n";
}