HomeSoftware Heritage

server/app: Fix aiohttp >= 3.7 exception related errors

Description

server/app: Fix aiohttp >= 3.7 exception related errors

Since aiohttp 3.7, the internal handling of aiohttp.web.HTTPException has changed
and a aiohttp.web_response.Response is now constructed from the exception text
then returned.

aiohttp exception constructions in swh-graph were passing error message through
the body keyword parameter instead of the text one, leading to an error related
to unicode decoding as body is expected to be bytes.

Using the text keyword parameter when constructing aiohttp exceptions now ensures
that response body will be properly encoded.

Closes T2768

Details