mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-08-14 06:05:34 +00:00
do not assert that network requests have a valid status code
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
parent
2d065bb3bc
commit
350bd0a793
@ -359,8 +359,11 @@ void EmbeddingLLMWorker::handleFinished()
|
|||||||
if (retrievedData.isValid() && retrievedData.canConvert<QVector<EmbeddingChunk>>())
|
if (retrievedData.isValid() && retrievedData.canConvert<QVector<EmbeddingChunk>>())
|
||||||
chunks = retrievedData.value<QVector<EmbeddingChunk>>();
|
chunks = retrievedData.value<QVector<EmbeddingChunk>>();
|
||||||
|
|
||||||
QVariant response = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
|
QVariant response;
|
||||||
Q_ASSERT(response.isValid());
|
if (reply->error() != QNetworkReply::NoError) {
|
||||||
|
response = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
|
||||||
|
Q_ASSERT(response.isValid());
|
||||||
|
}
|
||||||
bool ok;
|
bool ok;
|
||||||
int code = response.toInt(&ok);
|
int code = response.toInt(&ok);
|
||||||
if (!ok || code != 200) {
|
if (!ok || code != 200) {
|
||||||
|
@ -242,6 +242,12 @@ void Network::handleJsonUploadFinished()
|
|||||||
|
|
||||||
m_activeUploads.removeAll(jsonReply);
|
m_activeUploads.removeAll(jsonReply);
|
||||||
|
|
||||||
|
if (jsonReply->error() != QNetworkReply::NoError) {
|
||||||
|
qWarning() << "Request to" << jsonReply->url().toString() << "failed:" << jsonReply->errorString();
|
||||||
|
jsonReply->deleteLater();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QVariant response = jsonReply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
|
QVariant response = jsonReply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
|
||||||
Q_ASSERT(response.isValid());
|
Q_ASSERT(response.isValid());
|
||||||
bool ok;
|
bool ok;
|
||||||
@ -449,6 +455,11 @@ void Network::handleIpifyFinished()
|
|||||||
QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender());
|
QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender());
|
||||||
if (!reply)
|
if (!reply)
|
||||||
return;
|
return;
|
||||||
|
if (reply->error() != QNetworkReply::NoError) {
|
||||||
|
qWarning() << "Request to" << reply->url().toString() << "failed:" << reply->errorString();
|
||||||
|
reply->deleteLater();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QVariant response = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
|
QVariant response = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
|
||||||
Q_ASSERT(response.isValid());
|
Q_ASSERT(response.isValid());
|
||||||
@ -473,6 +484,11 @@ void Network::handleMixpanelFinished()
|
|||||||
QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender());
|
QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender());
|
||||||
if (!reply)
|
if (!reply)
|
||||||
return;
|
return;
|
||||||
|
if (reply->error() != QNetworkReply::NoError) {
|
||||||
|
qWarning() << "Request to" << reply->url().toString() << "failed:" << reply->errorString();
|
||||||
|
reply->deleteLater();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QVariant response = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
|
QVariant response = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
|
||||||
Q_ASSERT(response.isValid());
|
Q_ASSERT(response.isValid());
|
||||||
@ -511,6 +527,11 @@ void Network::handleHealthFinished()
|
|||||||
QNetworkReply *healthReply = qobject_cast<QNetworkReply *>(sender());
|
QNetworkReply *healthReply = qobject_cast<QNetworkReply *>(sender());
|
||||||
if (!healthReply)
|
if (!healthReply)
|
||||||
return;
|
return;
|
||||||
|
if (healthReply->error() != QNetworkReply::NoError) {
|
||||||
|
qWarning() << "Request to" << healthReply->url().toString() << "failed:" << healthReply->errorString();
|
||||||
|
healthReply->deleteLater();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QVariant response = healthReply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
|
QVariant response = healthReply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
|
||||||
Q_ASSERT(response.isValid());
|
Q_ASSERT(response.isValid());
|
||||||
|
Loading…
Reference in New Issue
Block a user