Feature: make `HTTPException` non-abstract
- Langage dominant
- Python
- Étoiles
- 16.5k
- Forks
- 2.4k
- Merge moyen
- 20 h 10 min
- PR mergées (30 j)
- 221
Description
## Long story short
Use-case: a server's handler uses a client to make a request to another server. I would like to re-use the response status code in the first server's response (the code below does not work as `HTTPException`'s constructor does not accept parameter `status_code`):
```
try:
...
except ClientResponseError as e:
status = e.status or 500
raise web.HTTPException(text=e.message, status_code=status)
```
Of course I can use `return web.Response(text=e.message, status=status)`, but `web.Response` cannot be throwed, however I need it in my applicatoin.
## Expected behaviour
I would expect `web.HTTPException` not to be abstract so that one can construct and raise it with a dynamic status code.
## Actual behaviour
one cannot create an instance of `web.HTTPException`
## Steps to reproduce
(not a bug so no steps to reproduce)
## Your environment
(not a bug so no environment description)
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.