commit
01ddc321ce
@ -16,7 +16,9 @@ class Get extends Adapter
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, $this->curl_dl_timeout);
|
||||
$response = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
if ($response === false) {
|
||||
throw new RequestException(curl_error($ch));
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,9 @@ class Post extends Adapter
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, $this->curl_connect_timeout_ms);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, $this->curl_dl_timeout);
|
||||
$response = curl_exec($ch);
|
||||
if ($response === false) {
|
||||
throw new RequestException(curl_error($ch));
|
||||
}
|
||||
curl_close($ch);
|
||||
|
||||
return $response;
|
||||
|
6
src/RateRequest/RequestException.php
Normal file
6
src/RateRequest/RequestException.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace pdt256\Shipping\RateRequest;
|
||||
|
||||
|
||||
class RequestException extends \Exception {}
|
Loading…
x
Reference in New Issue
Block a user