error_reporting(E_ALL) and catch (Exception $e) {

I have on top of my code the line

error_reporting(E_ALL);
echo $undefinedVariable;

This displays unstyled text. Is it possible to catch all errors that are displayed with error_reporting(E_ALL) via throw try block and then display those errors inside desired place?

tnx!

You might find set_error_handler useful. Errors and exceptions are separate things.