2018-11-03 18:07:45 +01:00
|
|
|
#ifndef SYNCTHINGWIDGETS_INTERNAL_ERROR_H
|
|
|
|
#define SYNCTHINGWIDGETS_INTERNAL_ERROR_H
|
2017-08-20 01:20:47 +02:00
|
|
|
|
|
|
|
#include "../global.h"
|
|
|
|
|
|
|
|
#include <c++utilities/chrono/datetime.h>
|
|
|
|
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <QString>
|
|
|
|
#include <QUrl>
|
|
|
|
|
2017-09-08 16:54:59 +02:00
|
|
|
namespace Data {
|
|
|
|
class SyncthingConnection;
|
|
|
|
enum class SyncthingErrorCategory;
|
2017-09-17 21:48:15 +02:00
|
|
|
} // namespace Data
|
2017-09-08 16:54:59 +02:00
|
|
|
|
2017-08-20 01:20:47 +02:00
|
|
|
namespace QtGui {
|
|
|
|
|
|
|
|
struct SYNCTHINGWIDGETS_EXPORT InternalError {
|
|
|
|
InternalError(const QString &message = QString(), const QUrl &url = QUrl(), const QByteArray &response = QByteArray());
|
|
|
|
|
2017-09-08 16:54:59 +02:00
|
|
|
static bool isRelevant(const Data::SyncthingConnection &connection, Data::SyncthingErrorCategory category, int networkError);
|
|
|
|
|
2017-08-20 01:20:47 +02:00
|
|
|
QString message;
|
|
|
|
QUrl url;
|
|
|
|
QByteArray response;
|
2019-06-10 22:48:26 +02:00
|
|
|
CppUtilities::DateTime when;
|
2017-08-20 01:20:47 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
inline InternalError::InternalError(const QString &message, const QUrl &url, const QByteArray &response)
|
|
|
|
: message(message)
|
|
|
|
, url(url)
|
|
|
|
, response(response)
|
2019-06-10 22:48:26 +02:00
|
|
|
, when(CppUtilities::DateTime::now())
|
2017-08-20 01:20:47 +02:00
|
|
|
{
|
|
|
|
}
|
2017-09-17 21:48:15 +02:00
|
|
|
} // namespace QtGui
|
2017-08-20 01:20:47 +02:00
|
|
|
|
2018-11-03 18:07:45 +01:00
|
|
|
#endif // SYNCTHINGWIDGETS_INTERNAL_ERROR_H
|