updated-packages
This commit is contained in:
@@ -26,14 +26,16 @@ use Psr\Http\Message\StreamInterface as Psr7StreamInterface;
|
||||
class GuzzleHandler
|
||||
{
|
||||
private static $validOptions = [
|
||||
'proxy' => true,
|
||||
'verify' => true,
|
||||
'timeout' => true,
|
||||
'debug' => true,
|
||||
'connect_timeout' => true,
|
||||
'stream' => true,
|
||||
'delay' => true,
|
||||
'sink' => true,
|
||||
'proxy' => true,
|
||||
'expect' => true,
|
||||
'cert' => true,
|
||||
'verify' => true,
|
||||
'timeout' => true,
|
||||
'debug' => true,
|
||||
'connect_timeout' => true,
|
||||
'stream' => true,
|
||||
'delay' => true,
|
||||
'sink' => true,
|
||||
];
|
||||
|
||||
/** @var ClientInterface */
|
||||
@@ -49,9 +51,9 @@ class GuzzleHandler
|
||||
|
||||
/**
|
||||
* @param Psr7Request $request
|
||||
* @param array $options
|
||||
*
|
||||
* @return Promise\Promise
|
||||
* @param array $options
|
||||
* @return Promise\Promise|Promise\PromiseInterface
|
||||
* @throws \GuzzleHttp\Exception\GuzzleException
|
||||
*/
|
||||
public function __invoke(Psr7Request $request, array $options = [])
|
||||
{
|
||||
|
||||
@@ -42,14 +42,17 @@ class GuzzleHandler
|
||||
|
||||
return $this->client->sendAsync($request, $this->parseOptions($options))
|
||||
->otherwise(
|
||||
static function (\Exception $e) {
|
||||
static function ($e) {
|
||||
$error = [
|
||||
'exception' => $e,
|
||||
'connection_error' => $e instanceof ConnectException,
|
||||
'response' => null,
|
||||
];
|
||||
|
||||
if ($e instanceof RequestException && $e->getResponse()) {
|
||||
if (
|
||||
($e instanceof RequestException)
|
||||
&& $e->getResponse()
|
||||
) {
|
||||
$error['response'] = $e->getResponse();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user