def inner(*args, **kwargs): try: return fn(*args, **kwargs) except (KeyboardInterrupt, RuntimeError): raise except: wrap_exception(exc_class)
def _get(self): if self._result is EmptyData: try: res = self.result_store.get(self.task_id) except: wrap_exception(DataStoreGetException) if res is not EmptyData: self._result = pickle.loads(res) return self._result else: return res else: return self._result
def execute(self, command): if not isinstance(command, QueueCommand): raise TypeError('Unknown object: %s' % command) result = command.execute() if result is None and not self.store_none: return if self.result_store and not isinstance(command, PeriodicQueueCommand): serialized = pickle.dumps(result) try: self.result_store.put(command.task_id, serialized) except: wrap_exception(DataStorePutException) return result
def _get(self, key, peek=False): try: if peek: return self.result_store.peek(key) else: return self.result_store.get(key) except: return wrap_exception(DataStoreGetException)
def _put(self, key, value): try: return self.result_store.put(key, value) except: return wrap_exception(DataStorePutException)
def read(self): try: return self.queue.read() except: wrap_exception(QueueReadException)
def write(self, msg): try: self.queue.write(msg) except: wrap_exception(QueueWriteException)
def inner(*args, **kwargs): try: return fn(*args, **kwargs) except: wrap_exception(exc_class)
def _remove(self, msg): try: return self.queue.remove(msg) except: wrap_exception(QueueRemoveException)
def raise_keyerror(): try: {}["huey"] except KeyError as exc: raise wrap_exception(MyException)
def raise_keyerror(): try: {}['huey'] except KeyError as exc: raise wrap_exception(MyException)