More errors messages (#353)

Add more error messages for HTTP errors/SSL errors
This commit is contained in:
cooolgamer
2026-03-04 15:04:15 +01:00
committed by GitHub
parent 69e0edffb4
commit 5e76d04eb0
4 changed files with 51 additions and 6 deletions

View File

@@ -1180,22 +1180,43 @@ redirect: // goto here if we need to redirect
break;
case HTTPC_ERROR:
DEBUG("httpc error %lx\n", _header.result_code);
if (_header.result_code == 0xd8a0a03c)
switch (_header.result_code)
{
// SSL failure - try curl?
case 0xd8a0a028: // bad zip file
case 0xd8a0a03c: // SSL failure
// try curl?
res = curl_http_get(url, filename, buf, size, acceptable_mime_types);
if (R_SUCCEEDED(res))
{
return res;
} else if (res == -2)
}
if(_header.result_code == 0xd8a0a028)
{
snprintf(err_buf, ERROR_BUFFER_SIZE, zip_not_available);
goto error;
}
else
{
snprintf(err_buf, ERROR_BUFFER_SIZE, language.remote.http_ssl_error, _header.result_code);
}
quit = false;
break;
case 0xd8a0a049:
// Timeout (bad wifi/proxy)
snprintf(err_buf, ERROR_BUFFER_SIZE, language.remote.http_timeout);
quit = false;
break;
case 0xd8a0a046:
// poor reception/no wifi/custom dns set
snprintf(err_buf, ERROR_BUFFER_SIZE, language.remote.http_no_network);
quit = false;
break;
default:
snprintf(err_buf, ERROR_BUFFER_SIZE, language.remote.generic_httpc_error, _header.result_code);
quit = true;
break;
}
snprintf(err_buf, ERROR_BUFFER_SIZE, language.remote.generic_httpc_error, _header.result_code);
throw_error(err_buf, ERROR_LEVEL_ERROR);
quit = true;
httpcCloseContext(&context);
return _header.result_code;
case SEE_OTHER: