Esempio n. 1
0
 /**
  * curl error
  * @param  \Guzzle\Common\Event $event
  * @throws KintoneException
  */
 public function onRequestException(Event $event)
 {
     $this->request = $event->offsetGet('request');
     $this->response = $event->offsetGet('response');
     $this->exception = $event->offsetGet('exception');
     if ($this->exception instanceof \Guzzle\Http\Exception\CurlException) {
         $errorNumber = $this->exception->getErrorNo();
         switch ($errorNumber) {
             case 6:
                 throw new KintoneException('kintone.unknown_url');
             case 35:
                 throw new KintoneException('kintone.invalid_cert');
             default:
                 throw new KintoneException('kintone.invalid_auth');
         }
     }
     throw new \Exception($this->exception->getMessage());
 }
Esempio n. 2
0
 /**
  * @param CurlException $exception\
  */
 private function processCurlError(CurlException $exception)
 {
     $error = 'Curl error: ' . $exception->getMessage();
     $this->log->error($error);
     $this->throwCurlException($exception->getErrorNo(), $exception->getError());
 }