A normal thrown and uncaught exception in PHP will produce output similar to this:
Fatal error: Uncaught exception 'Exception' with message 'Insufficient permissions or something' in /home/codemonkey/foo/bar/File.php:143 Stack trace: #0 /home/codemonkey/dev/foo/bar/SomeOtherFile.php(85): foo\bar\File::fromUpload(Array) #1 /home/codemonkey/dev/foo/bar/OmniDataFileImport.php(35): foo\bar\OmniDataFileImport->performFileImportLogic() #2 [internal function]: foo\bar\OmniDataFileImport->post(Object(Request), false) #3 /home/codemonkey/dev/foo/vendor/tonic/lib/tonic.php(654): call_user_func_array(Array, Array) #4 /home/codemonkey/dev/foo/dispatch.php(22): Resource->exec(Object(Request)) #5 {main} thrown in /home/codemonkey/dev/foo/broadnet/files/File.php on line 143
The message and stack trace is cool, but I would really like more information. For that reason I want to extend the Exception with more information such as local variables and their values. The problem is that PHP will probably still output the same above information but with the text "Uncaught exception 'MyException'" instead.
Can I override the way PHP displays uncaught exceptions? I recall reading about a function in PHP that you can set as a backup to catch all uncaught exceptions. Perhaps I can use that functionality to format my own message and kill the process.
Thanks for all helpful information on the topic