This is called when exiting the pipeline, but can be used for other
purposes (e.g. in nested pipelines).
"""
- with self._conn.lock:
- self._conn.wait(self._sync_gen())
+ try:
+ with self._conn.lock:
+ self._conn.wait(self._sync_gen())
+ except e.Error as ex:
+ raise ex.with_traceback(None)
def __enter__(self) -> "Pipeline":
self._enter()
if exc_val:
logger.warning("error ignored syncing %r: %s", self, exc2)
else:
- raise
+ raise exc2.with_traceback(None)
finally:
try:
self._exit()
if exc_val:
logger.warning("error ignored exiting %r: %s", self, exc2)
else:
- raise
+ raise exc2.with_traceback(None)
class AsyncPipeline(BasePipeline):
This is called when exiting the pipeline, but can be used for other
purposes (e.g. in nested pipelines).
"""
- async with self._conn.lock:
- await self._conn.wait(self._sync_gen())
+ try:
+ async with self._conn.lock:
+ await self._conn.wait(self._sync_gen())
+ except e.Error as ex:
+ raise ex.with_traceback(None)
async def __aenter__(self) -> "AsyncPipeline":
self._enter()
if exc_val:
logger.warning("error ignored syncing %r: %s", self, exc2)
else:
- raise
+ raise exc2.with_traceback(None)
finally:
try:
self._exit()
if exc_val:
logger.warning("error ignored exiting %r: %s", self, exc2)
else:
- raise
+ raise exc2.with_traceback(None)