finishRequest example

try {
            return $response = $this->handleRaw($request$type);
        } catch (\Throwable $e) {
            if ($e instanceof \Error && !$this->handleAllThrowables) {
                throw $e;
            }

            if ($e instanceof RequestExceptionInterface) {
                $e = new BadRequestHttpException($e->getMessage()$e);
            }
            if (false === $catch) {
                $this->finishRequest($request$type);

                throw $e;
            }

            return $response = $this->handleThrowable($e$request$type);
        } finally {
            $this->requestStack->pop();

            if ($response instanceof StreamedResponse) {
                $callback = $response->getCallback();
                $requestStack = $this->requestStack;

                
try {
            return $response = $this->handleRaw($request$type);
        } catch (\Throwable $e) {
            if ($e instanceof \Error && !$this->handleAllThrowables) {
                throw $e;
            }

            if ($e instanceof RequestExceptionInterface) {
                $e = new BadRequestHttpException($e->getMessage()$e);
            }
            if (false === $catch) {
                $this->finishRequest($request$type);

                throw $e;
            }

            return $response = $this->handleThrowable($e$request$type);
        } finally {
            $this->requestStack->pop();

            if ($response instanceof StreamedResponse) {
                $callback = $response->getCallback();
                $requestStack = $this->requestStack;

                
Home | Imprint | This part of the site doesn't use cookies.