MCPcopy Index your code
hub / github.com/apache/cassandra-python-driver / add_errback

Method add_errback

cassandra/cluster.py:5107–5123  ·  view source on GitHub ↗

Like :meth:`.add_callback()`, but handles error cases. An Exception instance will be passed as the first positional argument to `fn`.

(self, fn, *args, **kwargs)

Source from the content-addressed store, hash-verified

5105 return self
5106
5107 def add_errback(self, fn, *args, **kwargs):
5108 """
5109 Like :meth:`.add_callback()`, but handles error cases.
5110 An Exception instance will be passed as the first positional argument
5111 to `fn`.
5112 """
5113 run_now = False
5114 with self._callback_lock:
5115 # Always add fn to self._errbacks, even when we're about to execute
5116 # it, to prevent races with functions like start_fetching_next_page
5117 # that reset _final_exception
5118 self._errbacks.append((fn, args, kwargs))
5119 if self._final_exception:
5120 run_now = True
5121 if run_now:
5122 fn(self._final_exception, *args, **kwargs)
5123 return self
5124
5125 def add_callbacks(self, callback, errback,
5126 callback_args=(), callback_kwargs=None,

Callers 5

test_errbackMethod · 0.95
add_callbacksMethod · 0.95
test_async_timeoutsMethod · 0.80
submitAsyncMethod · 0.80

Calls

no outgoing calls

Tested by 3

test_errbackMethod · 0.76
test_async_timeoutsMethod · 0.64