/** * @param CurlException $e * @return StorageApiEvent */ public function curlError(CurlException $e) { $event = $this->prepareEvent(); $event->setMessage(sprintf(self::MESSAGE_END, $this->task->getRunUrl()))->setDescription($e->getError())->setType(StorageApiEvent::TYPE_WARN)->setResults(array('response' => $e->getError(), 'code' => $e->getErrorNo())); $this->save($event); return $event; }
public function testStoresCurlError() { $e = new CurlException(); $this->assertNull($e->getError()); $this->assertNull($e->getErrorNo()); $this->assertSame($e, $e->setError('test', 12)); $this->assertEquals('test', $e->getError()); $this->assertEquals(12, $e->getErrorNo()); }
public function testStoresCurlError() { $e = new CurlException(); $this->assertNull($e->getError()); $this->assertNull($e->getErrorNo()); $this->assertSame($e, $e->setError('test', 12)); $this->assertEquals('test', $e->getError()); $this->assertEquals(12, $e->getErrorNo()); $handle = new CurlHandle(curl_init(), array()); $e->setCurlHandle($handle); $this->assertSame($handle, $e->getCurlHandle()); $handle->close(); }
/** * @param CurlException $exception\ */ private function processCurlError(CurlException $exception) { $error = 'Curl error: ' . $exception->getMessage(); $this->log->error($error); $this->throwCurlException($exception->getErrorNo(), $exception->getError()); }