Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
Description
Don't rely on QtcProcess::errorString() when choosing possible code paths, as this is just a human readable string. Please see how QIODevice::errorString() is implemented.
Example misuse:
void RsyncDeployService::createRemoteDirectories() { ... connect(m_mkdir.get(), &QtcProcess::done, this, [this] { QString userError; const QString error = m_mkdir->errorString(); if (!error.isEmpty()) ^^^ userError = error; if (m_mkdir->exitCode() != 0) userError = QString::fromUtf8(m_mkdir->readAllStandardError()); if (!userError.isEmpty()) { emit errorMessage(tr("Failed to create remote directories: %1").arg(userError)); setFinished(); return; } deployFiles(); }); ... }
Client code should first check if QtcProcess::error() != QProcessError::UnknownError.
Currently it's being worked around inside QtcProcessPrivate::handleDone() - see HACK comment.