blink\core\Application::handleRequest PHP Method

handleRequest() public method

public handleRequest ( blink\http\Request $request ) : mixed
$request blink\http\Request
return mixed
    public function handleRequest($request)
    {
        if (!$this->bootstrapped) {
            return $this->internalServerError();
        }
        $this->currentRequest = $request;
        /** @var Response $response */
        $response = $this->get('response');
        try {
            $this->exec($request, $response);
        } catch (\Exception $e) {
            $response->data = $e;
            $this->get('errorHandler')->handleException($e);
        } catch (\Throwable $e) {
            $response->data = $e;
            $this->get('errorHandler')->handleException($e);
        }
        try {
            $response->callMiddleware();
        } catch (\Exception $e) {
            $response->data = $e;
        } catch (\Throwable $e) {
            $response->data = $e;
        }
        $this->formatException($response->data, $response);
        $response->prepare();
        $this->refreshServices();
        $this->currentRequest = null;
        return $response;
    }