getHeadersFromException example


#[Package('core')] class ErrorResponseFactory
{
    public function getResponseFromException(\Throwable $exception, bool $debug = false): Response
    {
        $response = new JsonResponse(
            null,
            $this->getStatusCodeFromException($exception),
            $this->getHeadersFromException($exception)
        );

        $response->setEncodingOptions($response->getEncodingOptions() | \JSON_INVALID_UTF8_SUBSTITUTE);
        $response->setData(['errors' => $this->getErrorsFromException($exception$debug)]);

        return $response;
    }

    /** * @return array<DefaultExceptionData|ShopwareExceptionData> */
    
Home | Imprint | This part of the site doesn't use cookies.