swh-scanner: print a nicer error message when rate limit is hit
currently, when that happens, a nasty traceback is spit out, ending with something like this:
swh.scanner.exceptions.APIError: API Error: "<bound method ClientResponse.text of <ClientResponse(https://archive.softwareheritage.org/api/1/known/) [429 Too Many Requests]>
<CIMultiDictProxy('Date': 'Fri, 28 Feb 2020 16:05:34 GMT', 'Server': 'gunicorn/19.9.0', 'Content-Type': 'application/json', 'Retry-After': '3507', 'Vary': 'Accept,Cookie', 'Allow': 'POST, OPTIONS', 'X-RateLimit-Limit': '120', 'X-RateLimit-Remaining': '0', 'X-RateLimit-Reset': '1582909441', 'X-Frame-Options': 'SAMEORIGIN', 'Content-Length': '71', 'Via': '1.1 archive.softwareheritage.org', 'Access-Control-Allow-Origin': '*', 'X-Varnish': '52209502', 'Age': '0', 'Via': '1.1 varnish (Varnish/6.1)', 'Strict-Transport-Security': 'max-age=15768000;', 'Connection': 'keep-alive')>
> with given values ['swh:1:dir:a0de650e15e7e1a65c459784b20851d24f945c9a', 'swh:1:dir:d1b8a4259238f327399a9533a70bbf4a4f5b612d', 'swh:1:cnt:f14e196529632bc4e37f7e7deb0b49db4742a423']"
we should output a nice(r) error message instead
Migrated from T2300 (view on Phabricator)