Skip to content

Commit

Permalink
Improve cURL error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
tsvgos committed Oct 24, 2018
1 parent 2b1779a commit 6ad4de9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ECB.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ private static function fetch(string $url): string
return $data;
}

$curl_error = curl_error($ch);
curl_close($ch);

throw new ECBException(curl_error($ch), ECBException::DATA_DOWNLOAD_FAILED);
throw new ECBException($curl_error, ECBException::DATA_DOWNLOAD_FAILED);
}
}

0 comments on commit 6ad4de9

Please sign in to comment.