예제 #1
0
    def _operate_on_cluster(self,
                            verb,
                            failtype,  # type: Type[CouchbaseException]
                            *args,
                            **kwargs):

        try:
            return verb(self, *args, **kwargs)
        except Exception as e:
            raise_from(failtype(params=CouchbaseException.ParamType(message="Cluster operation failed", inner_cause=e)), e)
예제 #2
0
 def _operate_on_an_open_bucket(self, verb, failtype, *args, **kwargs):
     try:
         return verb(
             self._get_an_open_bucket(
                 kwargs.pop('err_msg', 'Cluster has no open buckets')),
             *args, **kwargs)
     except Exception as e:
         raise_from(
             failtype(params=CouchbaseException.ParamType(
                 message='Cluster operation on bucket failed',
                 inner_cause=e)), e)