Coroutine-style usage converts most errors into StreamClosedErrors, which are logged less noisily while still allowing the original error to be seen via the new real_error attribute. SSL errors now typically result in a single log line instead of a full stack trace. Closes #1304.
This method can serve as a general replacement for methods like FacebookGraphMixin.facebook_request. Update docs for GoogleOAuth2Mixin.get_authenticated_user to indicate that only the tokens are returned, not other user information. Add some basic tests for GoogleOAuth2Mixin. This commit incorporates code from FanFani4 in #1212 and kippandrew in #1454.
This prevents imports from incorrectly being interpreted as relative to the 'tornado package, which would make the standard 'platform' module unimportable. See bdarnell/plop#21
Now all the reader has to do is copy one of the "Hello, world" examples to hello.py, copy the test example to test_hello.py, import AsyncHTTPTestCase, and run the test. It's still not entirely seamless and idiot-proof, but it's progress! Of note: the example test can now actually assert things about the response it receives.
The example code should just show the simple, obvious thing to do: call self.fetch(). Text afterwards explains how this relates to stop() and wait().
- encourage use of make_app() (makes testing easier) - use fully-qualified module paths (painful in real-world code, but makes examples clearer) - don't define a main() function that is never called: just use a boring old "__name__ == __main__" block, so the code can be copy + pasted + executed immediately - just use a tuple when defining routes, not url(...): this is supposed to be a simple, minimalist example
Encourage use of SSLContext on the server side.