title: Python BadYieldError: yielded unknown object HTTPError('HTTP 599: Connection closed',)
body: <p>I want to know why in this function:</p>
  
  <pre><code>@tornado.gen.engine
  def check_status_changes(netid, sensid):
  
      como_url = "".join(['http://131.114.52:44444/ztc?netid=', str(netid), \
                 '&amp;sensid=', str(sensid), '&amp;start=-5s&amp;end=-1s'])
  
      http_client = AsyncHTTPClient()
      response = yield tornado.gen.Task(http_client.fetch, como_url)
  
      if response.error:
          raise Exception(response.error)
  </code></pre>
  
  <p>when there's response.error, I obtain the title error... what I have to yield in order to catch the returned value in another function?</p>
  
  <p>I would after do something like:</p>
  
  <pre><code>try:
          periodic = tornado.ioloop.PeriodicCallback(check_status_changes(netid, sensid), 5000)
          value = periodic.start()
          print("Secondo")
          print value
      except:
          print("Quarto")
          periodic.stop()
          self.finish()
          return
      else:
  </code></pre>
  
  <p>I don't know... I would just compare the returned value with another....</p>
  
  <p>Thank you.</p>