Tornado 3.1 made the @asynchronous decorator optional when @coroutine
is used, but if it was used anyway both @asynchronous and the new code
would log any uncaught exceptions.
if not self._finished:
self.finish()
IOLoop.current().add_future(result, future_complete)
+ # Once we have done this, hide the Future from our
+ # caller (i.e. RequestHandler._when_complete), which
+ # would otherwise set up its own callback and
+ # exception handler (resulting in exceptions being
+ # logged twice).
+ return None
return result
return wrapper