mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-16 21:51:17 +00:00
Retry serverinfo query for adding a PC if the request fails with ServiceUnavailableError. Fixes #88
This commit is contained in:
+38
-2
@@ -5,7 +5,8 @@
|
||||
#include <Limelight.h>
|
||||
|
||||
#include <QUrl>
|
||||
#include <QtNetwork/QNetworkAccessManager>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
|
||||
class NvApp
|
||||
{
|
||||
@@ -52,7 +53,7 @@ public:
|
||||
|
||||
}
|
||||
|
||||
const char* what() const throw()
|
||||
const char* what() const
|
||||
{
|
||||
return m_StatusMessage.toLatin1();
|
||||
}
|
||||
@@ -77,6 +78,41 @@ private:
|
||||
QString m_StatusMessage;
|
||||
};
|
||||
|
||||
class QtNetworkReplyException : public std::exception
|
||||
{
|
||||
public:
|
||||
QtNetworkReplyException(QNetworkReply::NetworkError error, QString errorText) :
|
||||
m_Error(error),
|
||||
m_ErrorText(errorText)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
const char* what() const
|
||||
{
|
||||
return m_ErrorText.toLatin1();
|
||||
}
|
||||
|
||||
const char* getErrorText() const
|
||||
{
|
||||
return m_ErrorText.toLatin1();
|
||||
}
|
||||
|
||||
QNetworkReply::NetworkError getError() const
|
||||
{
|
||||
return m_Error;
|
||||
}
|
||||
|
||||
QString toQString() const
|
||||
{
|
||||
return m_ErrorText + " (Error " + QString::number(m_Error) + ")";
|
||||
}
|
||||
|
||||
private:
|
||||
QNetworkReply::NetworkError m_Error;
|
||||
QString m_ErrorText;
|
||||
};
|
||||
|
||||
class NvHTTP
|
||||
{
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user