Changed error handler from a class to a simple set_exception_handler() function using closures