Merge pull request #23978 from kaithar/issue/re-raise_preserving_context

Instead of raising the exception() instance, raise from exc_info()
This commit is contained in:
Thomas S Hatch 2015-05-22 10:28:30 -06:00
commit 033cc83b1b

View File

@ -577,8 +577,12 @@ class Minion(MinionBase):
# finish connecting to master
self._connect_master_future.add_done_callback(lambda f: self.io_loop.stop())
self.io_loop.start()
if self._connect_master_future.exception():
raise self._connect_master_future.exception()
# I made the following 3 line oddity to preserve traceback.
# Please read PR #23978 before changing, hopefully avoiding regressions.
# Good luck, we're all counting on you. Thanks.
future_exception = self._connect_master_future.exc_info()
if future_exception:
raise six.reraise(*future_exception)
@tornado.gen.coroutine
def connect_master(self):