Skip to content

Commit

Permalink
Merge pull request #45 from hove-io/refs_bo_3101_check
Browse files Browse the repository at this point in the history
Refs #BO-3101 - Add check curl error code.
  • Loading branch information
dvdn authored Mar 12, 2024
2 parents 6aeb3c2 + c416a8e commit c9fb2d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Service/NavitiaService.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ private function getApiResponse(

$ch = new CurlService($url, $this->timeout, $token, $this->logger);
$result = $ch->process();
if ($result['httpCode'] === 200) {
$curlErrorCode = $result['curlError'][0];

if ($result['httpCode'] === 200 && $curlErrorCode === 'NO_CURL_ERROR') {
$this->cache->setCacheItem($cacheKey, $result);
}
}
Expand Down

0 comments on commit c9fb2d7

Please sign in to comment.