MCPcopy Create free account
hub / github.com/Martchus/syncthingtray / internalAddError

Method internalAddError

syncthingwidgets/misc/internalerrorsdialog.cpp:92–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92void InternalErrorsDialog::internalAddError(const InternalError &error)
93{
94 const QString url = error.url.toString();
95 auto *const b = browser();
96 b->append(QChar('[') % QString::fromUtf8(error.when.toString(DateTimeOutputFormat::Iso, true).data()) % QChar(']') % QChar(' ') % error.message);
97 if (!url.isEmpty()) {
98 b->append(m_request % QChar(' ') % url);
99 }
100 if (!error.response.isEmpty()) {
101 b->append(m_response % QChar('\n') % QString::fromLocal8Bit(error.response));
102 }
103
104 // also log errors to console
105 using namespace EscapeCodes;
106 cerr << Phrases::Error << error.message.toLocal8Bit().data() << Phrases::End;
107 if (!error.url.isEmpty()) {
108 cerr << "request URL: " << url.toLocal8Bit().data() << '\n';
109 }
110 if (!error.response.isEmpty()) {
111 cerr << "response: " << error.response.data() << '\n';
112 }
113}
114
115void InternalErrorsDialog::updateStatusLabel()
116{

Callers 1

addErrorMethod · 0.80

Calls 2

toStringMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected