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;
	}