protected function populateResponseWithException(
		Exception\HttpCode $exception, Response $response, ?Producer\ProducerInterface $producer
	): Response
	{
		$response = $this->populateResponseWithData($exception->getPayload(), $response, $producer);
		if ($exception instanceof Exception\HeaderInterface)
		{
			foreach ($exception->getHeaders() as $name => $value)
			{
				$response = $response->withHeader($name, $value);
			}
		}
		$response = $response->withStatus($exception->getCode(), $exception->getMessage());
		return $response;
	}
protected function populateResponseWithException(
		Exception\HttpCode $exception, Response $response, ?Producer\ProducerInterface $producer
	): Response
	{
		$response = $this->populateResponseWithData($exception->getPayload(), $response, $producer);
		if ($exception instanceof Exception\HeaderInterface)
		{
			foreach ($exception->getHeaders() as $name => $value)
			{
				$response = $response->withHeader($name, $value);
			}
		}
		$response = $response->withStatus($exception->getCode(), $exception->getMessage());
		return $response;
	}
protected function populateResponseWithException ( Exception \ HttpCode $ exception , Response $ response , ? Producer \ ProducerInterface $ producer ) : Response { $ response = $ this -> populateResponseWithData ( $ exception -> getPayload ( ) , $ response , $ producer ) ; if ( $ exception instanceof Exception \ HeaderInterface ) { foreach ( $ exception -> getHeaders ( ) as $ name => $ value ) { $ response = $ response -> withHeader ( $ name , $ value ) ; } } $ response = $ response -> withStatus ( $ exception -> getCode ( ) , $ exception -> getMessage ( ) ) ; return $ response ; }
Populates response with data from exception using producer
@param Exception\HttpCode $exception
@param Response $response
@param null|Producer\ProducerInterface $producer
@return Response
Populates response with data from exception using producer