When we explicitly cancel an operation we shouldn't throw an error.

This commit is contained in:
Adam Treat 2023-07-12 10:34:10 -04:00
parent 13b2d47be5
commit 0d726b22b8

View File

@ -244,7 +244,7 @@ void ChatGPTWorker::handleReadyRead()
void ChatGPTWorker::handleErrorOccurred(QNetworkReply::NetworkError code)
{
QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender());
if (!reply) {
if (!reply || reply->error() == QNetworkReply::OperationCanceledError /*when we call abort on purpose*/) {
emit finished();
return;
}