title: Python tornado, gives an error inside open()
body: <p>I'm implementing a web socket server with tornado (currently version 3.1).</p>
  
  <p>Inside the <code>open()</code> function I check GET argument, then based on it - I want to raise an error.</p>
  
  <p>Something like this:</p>
  
  <pre><code>def open(self):
     token = self.get_argument('token')
     if ...:
        ??? # raise an error
  </code></pre>
  
  <p>How do I raise an error inside the open function? I did not find the way to do this.</p>
  
  <p>Thanks</p>