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

Method handleError

cli/application.cpp:339–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337}
338
339void Application::handleError(
340 const QString &message, SyncthingErrorCategory category, int networkError, const QNetworkRequest &request, const QByteArray &response)
341{
342 CPP_UTILITIES_UNUSED(category)
343 CPP_UTILITIES_UNUSED(networkError)
344
345 // skip error handling for shell completion
346 if (!m_argsRead) {
347 return;
348 }
349
350 // print error message and relevant request and response if present
351 cerr << Phrases::Override << Phrases::Error << message.toLocal8Bit().data() << Phrases::End;
352 const auto url = request.url();
353 if (!url.isEmpty()) {
354 cerr << "Request: " << url.toString(QUrl::PrettyDecoded).toLocal8Bit().data() << '\n';
355 }
356 if (!response.isEmpty()) {
357 cerr << "Response:\n";
358 cerr.write(response.data(), response.size());
359 if (!response.endsWith('\n')) {
360 cerr << '\n';
361 }
362 }
363 cerr << flush;
364 QCoreApplication::exit(-3);
365}
366
367void Application::requestLog(const ArgumentOccurrence &)
368{

Callers

nothing calls this directly

Calls 3

toStringMethod · 0.80
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected