environmentLoader->load(); $this->setExceptionHandler(); $response = $this->router->dispatch($this->serverRequest); $this->sapiEmitter->emit($response); } private function setExceptionHandler(): void { if (Environment::Production->isCurrent()) { set_exception_handler($this->exceptionHandler->handle(...)); return; } $whoops = new Run(); $whoops->pushHandler(new PrettyPageHandler()); $whoops->register(); } }