Deprecate returning web.HTTPException from handlers and middlewares #2415
Description
Now an endpoint might either return web.HTTPException (HTTPForbidden for example) or raise it.
It makes a mess, very often a middleware should check for type of response and process it as exception if the response is an instance of HTTPException.
Deprecation could be added just before this line: https://github.com/aio-libs/aiohttp/blob/master/aiohttp/web_protocol.py#L428
Next step in transition plan is adding HTTPException.make_response() method.
At the end we could drop inheritance from web.Response at all.
@tailhook told me about the problem a year ago.
aiohttp.web was designed after Pyramid framework.
I still think Pyramid is much better designed than Django and Flask but the library is not such popular because alternatives acquired much better promotion.
Anyway, Pyramid inherits HTTP exceptions from both Response and Exception classes, we did the same.
Now, after years of working on aiohttp and derived projects, it's clean for me: the choice was definitely wrong.
I was not ready for such breaking change at the moment but now I have a strong feeling that the change makes sense and very important.
Sure, we should do transition smoothly: a warning and make_response() method could be added in next aiohttp 3.0 release but web.Response removal should wait for a year and half at least.
Champions for first two steps are welcome!