Try each service to send conversion, while getting UnsupportedConversionException

@param ConversionInterface $conversion

@throws UnsupportedConversionTypeException
@throws DuplicatedConversionException
@throws RequestException

@return ResponseInterface
483551
public function send(ConversionInterface $conversion): ResponseInterface
    {
        foreach ($this->services as $service) {
            if (is_null($service->getConfig())) {
                $config = $this->config->getConfiguredConfigInstance($service);
                if ($config instanceof PostbackServiceConfigInterface) {
                    $service->setConfig($config);
                } else {
                    continue;
                }
            }

            try {
                return $service->send($conversion);
            } catch (UnsupportedConversionTypeException $exception) {
                continue;
            }
        }
        throw new UnsupportedConversionTypeException($this, $conversion);
    }
278015
protected function prepareTypeConverterMap()
    {
        $typeConverterMap = [];
        $typeConverterClassNames = static::getTypeConverterImplementationClassNames($this->objectManager);
        foreach ($typeConverterClassNames as $typeConverterClassName) {
            /** @var TypeConverterInterface $typeConverter */
            $typeConverter = $this->objectManager->get($typeConverterClassName);
            foreach ($typeConverter->getSupportedSourceTypes() as $supportedSourceType) {
                $normalizedSourceType = TypeHandling::normalizeType($supportedSourceType);
                $normalizedTargetType = TypeHandling::normalizeType($typeConverter->getSupportedTargetType());
                if (isset($typeConverterMap[$normalizedSourceType][$normalizedTargetType][$typeConverter->getPriority()])) {
                    throw new Exception\DuplicateTypeConverterException('There exist at least two converters which handle the conversion from "' . $supportedSourceType . '" to "' . $normalizedTargetType . '" with priority "' . $typeConverter->getPriority() . '": ' . $typeConverterMap[$supportedSourceType][$normalizedTargetType][$typeConverter->getPriority()] . ' and ' . get_class($typeConverter), 1297951378);
                }
                $typeConverterMap[$normalizedSourceType][$normalizedTargetType][$typeConverter->getPriority()] = $typeConverterClassName;
            }
        }

        return $typeConverterMap;
    }
403753
protected function convertResponse(ResponseInterface $response)
    {
        $this->response->setContent($response->getBody());
        $this->response->setStatusCode($response->getStatusCode());
        foreach ($response->getHeaders() as $name => $values) {
            $this->response->setHeader($name, implode(', ', $values));
        }

        return $this->response;
    }
44293
public function convertSource(SourceInterface $source): void
    {
        $converters = $source->data()->get('converters');
        if (!$converters || !is_array($converters)) {
            $converters = ['null'];
        }

        foreach ($converters as $converter) {
            $this->eventDispatcher->dispatch(
                Sculpin::EVENT_BEFORE_CONVERT,
                new ConvertEvent($source, $converter, $this->formatterManager->defaultFormatter())
            );
            $this->converter($converter)->convert(new SourceConverterContext($source));
            $this->eventDispatcher->dispatch(
                Sculpin::EVENT_AFTER_CONVERT,
                new ConvertEvent($source, $converter, $this->formatterManager->defaultFormatter())
            );
        }
    }
1139404
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $method = $this->getOverrideMethod($request);

        if (!empty($method) && $method !== $request->getMethod()) {
            $allowed = $this->getAllowedOverrideMethods($request);

            if (!empty($allowed)) {
                if (in_array($method, $allowed)) {
                    $request = $request->withMethod($method);
                } else {
                    return $this->createResponse(405);
                }
            }
        }

        return $handler->handle($request);
    }
294288
private function doTransformObjectResponse(ObjectResponse $objectResponse)
    {
        $responseData = $objectResponse;

        if ($objectResponse->isActionTransform()) {
            try {
                $responseData = $this->transformerManager->transform(
                    $responseData->getObject(),
                    $objectResponse->getTransformerContext()
                );

                if (!is_object($responseData)) {
                    throw UnexpectedTypeException::create($responseData, 'object');
                }
            } catch (TransformerUnsupportedObjectException $e) {
                throw new \RuntimeException(sprintf(
                    'Can not transform object with class "%s".',
                    get_class($objectResponse)
                ), 0, $e);
            }
        }

        try {
            $responseData = $this->normalizerManager->normalize(
                $responseData instanceof ObjectResponse ? $responseData->getObject() : $responseData,
                $objectResponse->getNormalizerContext()
            );

            if (!is_array($responseData)) {
                throw UnexpectedTypeException::create($responseData, 'array');
            }
        } catch (NormalizerUnsupportedObjectException $e) {
            throw new \RuntimeException(sprintf(
                'Can not normalize object with class "%s".',
                get_class($responseData)
            ), 0, $e);
        }

        if ($objectResponse->isEmptyResponse()) {
            $response = new EmptyResponse($responseData, $objectResponse->getHttpStatusCode());
        } else {
            $response = new Response($responseData, $objectResponse->getHttpStatusCode());
        }

        return $response;
    }
677411
public function convertFrom($source, $targetType, array $convertedChildProperties = [], PropertyMappingConfigurationInterface $configuration = null)
    {
        try {
            $role = $this->policyService->getRole($source);
        } catch (NoSuchRoleException $exception) {
            return new Error('Could not find a role with the identifier "%s".', 1397212327, [$source]);
        }
        return $role;
    }
229280
private ConversionService getConversionService() {
		if (conversionService != null)
			return conversionService;

		try {
			conversionService = (ConversionService) ctx.getBean("daoConversionService");
			if (conversionService != null)
				return conversionService;
		} catch (Exception e) {
		}

		ConversionServiceFactoryBean factory = new ConversionServiceFactoryBean();
		factory.afterPropertiesSet();
		conversionService = factory.getObject();
		return conversionService;
	}
93979
public function convertResponse($response, $serviceResource)
    {
        $resourceName = substr($serviceResource, 0, -2);
        return $this->_convertResponseToModel($response, $resourceName);
    }
1041196
public function add(TypeConverterInterface $converter): self
    {
        if ($this->has($converter)) {
            throw new InvalidArgumentException(
                'Converter for this type already exists'
            );
        }

        return $this->set($converter);
    }
63236
protected function addManipulationToConversion(Manipulations $manipulations, string $conversionName)
    {
        optional($this->first(function (Conversion $conversion) use ($conversionName) {
            return $conversion->getName() === $conversionName;
        }))->addAsFirstManipulations($manipulations);

        if ($conversionName === '*') {
            $this->each->addAsFirstManipulations(clone $manipulations);
        }
    }
717661
private function processResponse(ResponseInterface $response)
    {
        if (200 !== $response->getStatusCode()) {
            throw new \RuntimeException('Query to the API server did not result in an appropriate response code');
        }

        $body = guzzle_json_decode((string) $response->getBody(), true);

        if ('OK' !== $body['error']) {
            throw new \RuntimeException('Query to the API server did not result in an appropriate response code');
        }

        return $body;
    }
137337
private function decodeResponse(ResponseInterface $response): ResponseInterface
    {
        $response = $this->decodeOnEncodingHeader('Transfer-Encoding', $response);

        if ($this->useContentEncoding) {
            $response = $this->decodeOnEncodingHeader('Content-Encoding', $response);
        }

        return $response;
    }
978412
public function send(RequestInterface $request)
    {
        if (!RequestMethods::isAllowed($request->getMethod())) {
            throw new RequestException('request method is not allowed');
        }

        $transportRequest = $this->transport->createRequest($request->getMethod());
        $transportRequest->setPath($this->generatePath($request));
        $transportRequest = $this->setBody($transportRequest, $request->getBody());
        $transportRequest = $this->setQueryParameters($transportRequest, $request->getParameters());

        try {
            $transportResponse = $this->transport->send($transportRequest);
        } catch (TransportLayerException $exception) {
            $clientException = new ClientException($exception->getMessage(), $exception->getCode(), $exception);
            throw $clientException;
        }

        $rawData = (string)$transportResponse->getBody();

        /** @var Response $response */
        $response = $request->createResponse($rawData, $request->getSerializer(), $request->getSerializerParams());
        $supportedClass = $request->getSupportedClass();

        $this->mangleSupportedClass($response, $supportedClass);

        return $response;
    }
1046651
protected function handleErrors(ResponseInterface $response)
    {
        switch ($response->getStatusCode()) {
            case 401:
                throw new DomainExceptions\InvalidApiKeyException('Invalid API key');
                break;
            case 403:
                throw new DomainExceptions\InsufficientPrivilegesException('Insufficient Privileges');
                break;
            case 404:
                throw new DomainExceptions\NotFoundException('Not found');
                break;
            case 422:
                throw new DomainExceptions\UnprocessableEntityException('Unprocessable entity');
            case 429:
                throw new DomainExceptions\RateLimitExceededException('Rate limit exceeded');
            default:
                throw new DomainExceptions\UnknownErrorException('Unknown error');
                break;
        }
    }
244635
protected function getConverter($contentType)
    {
        if (!isset($this->supportedMediaTypes[$contentType])) {
            throw new Exception("No converter found for content type '$contentType'");
        }

        $converterClass = $this->supportedMediaTypes[$contentType];

        return new $converterClass;
    }
1267870
private function getHttpResponse(RequestInterface $request): ?ResponseInterface
    {
        try {
            return $this->httpClient->send($request);
        } catch (TooManyRedirectsException $tooManyRedirectsException) {
            return $this->httpHistoryContainer->getLastResponse();
        } catch (BadResponseException $badResponseException) {
            $this->badRequestCount++;

            if ($this->isBadRequestLimitReached()) {
                return $badResponseException->getResponse();
            }

            return $this->getHttpResponse($request);
        } catch (HttpConnectException $connectException) {
            throw $connectException;
        } catch (RequestException $requestException) {
            if ($this->isCurlException($requestException)) {
                throw new HttpConnectException(
                    $requestException->getMessage(),
                    $requestException->getRequest(),
                    $requestException->getPrevious()
                );
            }

            $this->badRequestCount++;

            if ($this->isBadRequestLimitReached()) {
                return $requestException->getResponse();
            }

            return $this->getHttpResponse($request);
        }
    }