From fbb34ad74643bbc69d141e26e105bcef3cdbc62c Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 3 Mar 2024 23:41:54 +0300 Subject: [PATCH] Feat(Robots/bkmk_rrequests): Report 40x and 50x errors --- Robots/bkmk_rrequests.py | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.39.5