__construct() public method

public __construct ( $message, Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response = null, Exception $previous = null, array $handlerContext = [] )
$request Psr\Http\Message\RequestInterface
$response Psr\Http\Message\ResponseInterface
$previous Exception
$handlerContext array
コード例 #1
0
 /**
  * @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
0
ファイル: RDException.php プロジェクト: rluders/rdstation
 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
0
 /**
  * @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
0
 public function __construct($message, RequestException $e)
 {
     parent::__construct($message, $e->getRequest(), $e->getResponse(), $e);
 }
コード例 #5
0
ファイル: ConnectException.php プロジェクト: aWEBoLabs/taxi
 public function __construct($message, RequestInterface $request, \Exception $previous = null, array $handlerContext = [])
 {
     parent::__construct($message, $request, null, $previous, $handlerContext);
 }
コード例 #6
0
 /**
  * @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
0
 /**
  * @param GuzzleRequestException $exception
  */
 public function __construct(GuzzleRequestException $exception)
 {
     $this->guzzleException = $exception;
     parent::__construct($exception->getMessage(), $exception->getRequest(), $exception->getResponse(), $exception);
 }
コード例 #8
0
ファイル: RequestException.php プロジェクト: keika299/chap
 public function __construct(\GuzzleHttp\Exception\RequestException $exception)
 {
     parent::__construct($exception->getMessage(), $exception->getRequest(), $exception->getResponse(), $exception->getPrevious(), $exception->getHandlerContext());
 }
コード例 #9
0
 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;
 }