public function run(): Response
    {
        try {
            $response = $this->dispatch();
            $this->send($response);
        } catch (\Error $e) {
            $response = $this->exceptionHandler->handleError($e);
            $this->send($response);
        } catch (\Exception $e) {
            $response = $this->exceptionHandler->handleException($e);
            $this->send($response);
        }

        return $response;
    }
public function run(): Response
    {
        try {
            $response = $this->dispatch();
            $this->send($response);
        } catch (\Error $e) {
            $response = $this->exceptionHandler->handleError($e);
            $this->send($response);
        } catch (\Exception $e) {
            $response = $this->exceptionHandler->handleException($e);
            $this->send($response);
        }

        return $response;
    }
public function run ( ) : Response { try { $ response = $ this -> dispatch ( ) ; $ this -> send ( $ response ) ; } catch ( \ Error $ e ) { $ response = $ this -> exceptionHandler -> handleError ( $ e ) ; $ this -> send ( $ response ) ; } catch ( \ Exception $ e ) { $ response = $ this -> exceptionHandler -> handleException ( $ e ) ; $ this -> send ( $ response ) ; } return $ response ; }
Runs the application and passes all errors to exception handler.

@return Response
Runs the application and passes all errors to exception handler .