forException() public static method

.
public static forException ( Exception $exception ) : static
$exception Exception The exception that caused this exception.
return static The new exception.
 /**
  * {@inheritdoc}
  */
 public function clear()
 {
     try {
         $this->clientClear();
     } catch (Exception $e) {
         throw WriteException::forException($e);
     }
 }
 /**
  * {@inheritdoc}
  */
 public function clear()
 {
     try {
         $this->collection->drop();
     } catch (Exception $e) {
         throw WriteException::forException($e);
     }
 }
示例#3
0
 private function doUpdate($key, $value)
 {
     $serialized = Serializer::serialize($value);
     try {
         $this->connection->update($this->tableName, array('meta_value' => $serialized), array('meta_key' => $key));
     } catch (Exception $e) {
         throw WriteException::forException($e);
     }
 }
示例#4
0
 /**
  * {@inheritdoc}
  */
 public function clear()
 {
     try {
         $bucket = $this->client->bucket($this->bucketName);
         foreach ($bucket->getKeys() as $key) {
             $bucket->get($key)->delete();
         }
     } catch (Exception $e) {
         throw WriteException::forException($e);
     }
 }