From ce23a98ae1c8e2436bad6359b154b5a3e8691552 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Fri, 12 Jul 2019 02:44:00 -0400 Subject: [PATCH] better error logging --- src/github.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/github.cpp b/src/github.cpp index 9bdc766..6e247f7 100644 --- a/src/github.cpp +++ b/src/github.cpp @@ -170,7 +170,13 @@ void GitHub::onFinished(const Request& req) void GitHub::onError(const Request& req, QNetworkReply::NetworkError error) { - qDebug("network error %d", error); + // the only way the request can be aborted is when there's a timeout, which + // already logs a message + if (error != QNetworkReply::OperationCanceledError) { + qCritical().noquote().nospace() + << "Github: request for " << req.reply->url().toString() << " failed, " + << req.reply->errorString() << " (" << error << ")"; + } req.timer->stop(); req.reply->disconnect(); @@ -185,7 +191,8 @@ void GitHub::onError(const Request& req, QNetworkReply::NetworkError error) void GitHub::onTimeout(const Request& req) { - qDebug("timeout"); + qCritical().noquote().nospace() + << "Github: request for " << req.reply->url().toString() << " timed out"; // don't delete the reply, abort will fire the error() handler above req.reply->abort();