Commit Graph

6 Commits

Author SHA1 Message Date
Marcos Schroh df2985f50e Missing annotations debug module (#68)
* fix(Missing annotation): missing annotations added on debug module.

* fix(debug.py): linting fixed.

* fix(debug annotations): annotations fixed.

* fix(): ASGIInstance annotation type should be used on return of _DebugResponder __call__ method.

* fix(): Exception type should be used instead of Any.
2018-09-28 10:41:22 +01:00
Jordan Eremieff f4fe0ec312 Name changes (#55)
* Rename View -> HTTPEndpoint

* Rename views doc file -> endpoints

* Rename request/response files -> requests/responses, update imports, update docs

* Rename WebSocketSession -> WebSocket, rename session -> websocket in docs

* Full module imports in tests and source, removing imports from __init__ file

* Fix name in testclient doc
2018-09-05 10:29:04 +01:00
Tom Christie 67d95fcfa7
Exception handling (#54)
* Exception handling

* Black formatting

* Add exception handling to App

* Handle cases where exception raised but response already started

* Order exception handler lookup by class inheritance

* Handle 404/405 as responses without App, or exceptions with it.

* Only use TestClient(app, raise_exceptions=False) explicitly inside test cases

* Documentation for ExceptionMiddleware

* Drop error_handler/exception_handler distinction.

* Finesse and document TestClient(app, raise_server_exceptions=False)

* Refactoring to make debug responses easier to obtain from elsewhere in code

* Use named status_code argument in example

* Clean up raise_server_errors usage in tests

* Consistent title-casing in HTTP reason phrases

* Black formatting

* Add WebSocketClose close. Omit message-body on 204, 304 exception cases.

* Black formatting

* Add 'debug' flag to App and ExceptionMiddleware

* Support app.debug

* Document debug mode

* Documenting debug
2018-09-04 11:52:29 +01:00
Tom Christie 12d55a321a Show exceptions that occur during app init. Ignore non-http scopes. 2018-07-18 15:34:13 +01:00
Tom Christie ddc358f2a6 Black formatting 2018-07-18 13:08:06 +01:00
Tom Christie 9838af83ca Add DebugMiddleware 2018-07-18 13:04:14 +01:00