If I don\'t catch an exception in PHP, I get a helpful error message in my error.log file with a stack trace. For example, if I run:
error.log
You can use the methods from PHP's base Exception class.
Use getMessage to get the message Oh no! and use getTraceAsString to get a formatted trace.
getMessage
Oh no!
getTraceAsString