本文整理汇总了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;
}