From: Michael Tremer Date: Mon, 29 Apr 2019 22:49:41 +0000 (+0100) Subject: http: Handle Bad Request errors X-Git-Tag: 0.9.28~1285^2~1039 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=785d371134cf4022a37725a955c73f9242be23bb;p=pakfire.git http: Handle Bad Request errors Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/http.py b/src/pakfire/http.py index 1c4429b90..c77bd3aae 100644 --- a/src/pakfire/http.py +++ b/src/pakfire/http.py @@ -221,7 +221,9 @@ class Client(object): except urllib.error.HTTPError as e: log.debug("HTTP Response: %s" % e.code) - if e.code == 403: + if e.code == 400: + raise BadRequestError() + elif e.code == 403: raise ForbiddenError() elif e.code == 404: raise NotFoundError() @@ -533,6 +535,13 @@ class HTTPError(DownloadError): pass +class BadRequestError(HTTPError): + """ + HTTP Error 400 - Bad Request + """ + pass + + class ForbiddenError(HTTPError): """ HTTP Error 403 - Forbidden