From: Oleg Broytman Date: Sun, 3 Mar 2024 20:41:54 +0000 (+0300) Subject: Feat(Robots/bkmk_rrequests): Report 40x and 50x errors X-Git-Tag: 5.2.3~1 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=fbb34ad74643bbc69d141e26e105bcef3cdbc62c;p=bookmarks_db.git Feat(Robots/bkmk_rrequests): Report 40x and 50x errors --- diff --git a/Robots/bkmk_rrequests.py b/Robots/bkmk_rrequests.py index f0d04da..08fe09e 100644 --- a/Robots/bkmk_rrequests.py +++ b/Robots/bkmk_rrequests.py @@ -84,4 +84,7 @@ def request_get(url, headers, timeout, proxy): except requests.RequestException as e: return str(e), None else: + if r.status_code >= 400: + error = requests.status_codes._codes[r.status_code][0] + return '%d %s' % (r.status_code, error), None return None, r