public function register()
{
set_error_handler([$this, 'handleError']);
if (!$this->rethrow) {
set_exception_handler([$this, 'handleUncaught']);
register_shutdown_function([$this, 'handleShutdown']);
} else {
register_shutdown_function([$this, 'throwFatalErrorException']);
}
}