guzzle = $guzzle; } /** * @param $request RequestInterface * @param $options array * * @throws AffilinetProductWebserviceException * * @return ResponseInterface */ public function send(RequestInterface $request, array $options = []) { $options = array_merge($options, ['http_errors' => false]); $psr7Response = $this->guzzle->send($request, $options); if ($psr7Response->getStatusCode() === 400) { $responseArray = \GuzzleHttp\json_decode($psr7Response->getBody(), true); throw new AffilinetProductWebserviceException($responseArray['ErrorMessages'][0]['Value']); } return $psr7Response; } }