Add comments for http status >=300 check

CURA-6005
This commit is contained in:
Lipu Fei 2019-01-08 13:29:45 +01:00
parent b4b7e1fc21
commit 53cb2ce189

View file

@ -45,6 +45,8 @@ class DriveApiService:
"Authorization": "Bearer {}".format(access_token)
})
# HTTP status 300s mean redirection. 400s and 500s are errors.
# Technically 300s are not errors, but the use case here relies on "requests" to handle redirects automatically.
if backup_list_request.status_code >= 300:
Logger.log("w", "Could not get backups list from remote: %s", backup_list_request.text)
Message(catalog.i18nc("@info:backup_status", "There was an error listing your backups."), title = catalog.i18nc("@info:title", "Backup")).show()