This catches aiohttp.ClientError and returns HTTPStatus<503> rather than HTTPStatus<500>.
We also catch the base aiohttp.ClientError rather than just aiohttp.ClientConnectorError, as for us, most client errors will also be TCP connection related, rather than actual invalid request data, etc and we include the exception information with the logged message, this can further aid debugging.
About this change - What it does
This catches
aiohttp.ClientError
and returnsHTTPStatus<503>
rather thanHTTPStatus<500>
. We also catch the baseaiohttp.ClientError
rather than justaiohttp.ClientConnectorError
, as for us, most client errors will also be TCP connection related, rather than actual invalid request data, etc and we include the exception information with the logged message, this can further aid debugging.References: HH-3866
Why this way
Reflects properly the behaviour of the server via the response status.