本文整理匯總了PHP中GuzzleHttp\Exception\RequestException::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP RequestException::__construct方法的具體用法?PHP RequestException::__construct怎麽用?PHP RequestException::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GuzzleHttp\Exception\RequestException
的用法示例。
在下文中一共展示了RequestException::__construct方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* @param string $message Exception message
* @param CommandTransaction $trans Contextual transfer information
* @param \Exception $previous Previous exception (if any)
*/
public function __construct($message, CommandTransaction $trans, \Exception $previous = null)
{
$this->trans = $trans;
$request = $trans->request ?: new Request(null, null);
$response = $trans->response;
parent::__construct($message, $request, $response, $previous);
}
示例2: __construct
public function __construct($message = null, $code = 0, Exception $previous = null)
{
switch ($code) {
case 401:
$message = 'Invalid token.';
break;
case 400:
$message = 'Identifier not found or invalid email/email_lead data.';
break;
}
parent::__construct($message, $code, $previous);
}
示例3: __construct
/**
* @param string $message
* @param RequestInterface $request
* @param ResponseInterface $response
* @param Exception $previous
*/
public function __construct($message, RequestInterface $request, ResponseInterface $response = null, Exception $previous = null)
{
parent::__construct($message, $request, $response, $previous);
$this->addContext(['request' => (string) $request, 'response' => (string) $response]);
}
示例4: __construct
public function __construct($message, RequestException $e)
{
parent::__construct($message, $e->getRequest(), $e->getResponse(), $e);
}
示例5: __construct
public function __construct($message, RequestInterface $request, \Exception $previous = null, array $handlerContext = [])
{
parent::__construct($message, $request, null, $previous, $handlerContext);
}
示例6: __construct
/**
* @param string $message
* @param RequestInterface $request
* @param ResponseInterface $response
* @param \Exception $previous
*/
public function __construct($message, RequestInterface $request, ResponseInterface $response = null, \Exception $previous = null)
{
parent::__construct($message, $request, $response, $previous);
}
示例7: __construct
/**
* @param GuzzleRequestException $exception
*/
public function __construct(GuzzleRequestException $exception)
{
$this->guzzleException = $exception;
parent::__construct($exception->getMessage(), $exception->getRequest(), $exception->getResponse(), $exception);
}
示例8: __construct
public function __construct(\GuzzleHttp\Exception\RequestException $exception)
{
parent::__construct($exception->getMessage(), $exception->getRequest(), $exception->getResponse(), $exception->getPrevious(), $exception->getHandlerContext());
}
示例9: __construct
public function __construct($message, $code, ConnectException $connectException = null)
{
$request = is_null($connectException) ? new HttpRequest('GET', 'http://example.com/') : $connectException->getRequest();
parent::__construct($message, $request);
$this->curlCode = $code;
}