kioslave: map more HTTP status codes to KIO errors

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-05-11 23:25:33 +03:00
parent a48d4cbb28
commit 16cf3fab27

View file

@ -123,11 +123,18 @@ static inline KIO::Error curlToKIOError(const CURLcode curlcode)
static inline KIO::Error HTTPToKIOError(const int httpcode)
{
// TODO: handle more codes
switch (httpcode) {
case 401: {
case 401:
case 403:
case 407: {
return KIO::ERR_COULD_NOT_AUTHENTICATE;
}
case 408: {
return KIO::ERR_SERVER_TIMEOUT;
}
case 500: {
return KIO::ERR_INTERNAL_SERVER;
}
default: {
return KIO::ERR_NO_CONTENT;
}