1
0
mirror of https://github.com/mbirth/tcl_ota_check.git synced 2024-09-19 22:33:25 +01:00

Throw human readable exception for 404 errors.

This commit is contained in:
Markus Birth 2017-09-12 21:39:37 +02:00
parent 237280cbea
commit f1071509db

View File

@ -87,6 +87,8 @@ class FotaCheck:
return req.text
elif req.status_code == 204:
raise requests.exceptions.HTTPError("No update available.", response=req)
elif req.status_code == 404:
raise requests.exceptions.HTTPError("No data for requested CUREF/FV combination.", response=req)
elif req.status_code in (500, 503):
raise requests.exceptions.HTTPError("Server busy, try again later.", response=req)
else: