diff options
author | Marcus Tillmanns <marcus.tillmanns@qt.io> | 2022-09-06 09:19:37 +0200 |
---|---|---|
committer | Marcus Tillmanns <marcus.tillmanns@qt.io> | 2022-09-08 05:39:48 +0000 |
commit | 0cb3459c718b8f32ed7bca1da5b804568fb5d3ad (patch) | |
tree | 7ba074f706533ff62b9583c4f4ec0982d9d95e46 | |
parent | aeb5f90d7189bdf4d4541545ffba9478ad16107d (diff) | |
download | qt-creator-0cb3459c718b8f32ed7bca1da5b804568fb5d3ad.tar.gz |
Terminal: Improve error message for start errors
Also fixes an issue where "Open Shell In Container" would fail if
the container has not been started yet.
Previously only "An Error occurred" was displayed to the user if
starting the terminal failed.
With this fix it gives more info about what went wrong, and a
specific error message is created if the openTerminal.py script
is not executable.
Change-Id: I49ae0d9b2aa7d5a27a9b100830b4fdefa5a279b8
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
-rw-r--r-- | src/libs/utils/terminalprocess.cpp | 8 | ||||
-rw-r--r-- | src/plugins/docker/dockerdevice.cpp | 9 |
2 files changed, 8 insertions, 9 deletions
diff --git a/src/libs/utils/terminalprocess.cpp b/src/libs/utils/terminalprocess.cpp index c140a1e6e6..32beff6c35 100644 --- a/src/libs/utils/terminalprocess.cpp +++ b/src/libs/utils/terminalprocess.cpp @@ -393,12 +393,12 @@ void TerminalImpl::start() d->m_process.setCommand({FilePath::fromString(terminal.command), allArgs}); d->m_process.setProcessImpl(m_setup.m_processImpl); d->m_process.setReaperTimeout(m_setup.m_reaperTimeout); + d->m_process.start(); if (!d->m_process.waitForStarted()) { - const QString msg - = QtcProcess::tr("Cannot start the terminal emulator \"%1\", change the setting in the " - "Environment options.") - .arg(terminal.command); + const QString msg = QtcProcess::tr("Cannot start the terminal emulator \"%1\", change the " + "setting in the Environment options. (%2)") + .arg(terminal.command).arg(d->m_process.errorString()); cleanupAfterStartFailure(msg); return; } diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 9946d899f5..08bc676649 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -333,8 +333,10 @@ DockerDevice::DockerDevice(DockerSettings *settings, const DockerDeviceData &dat proc->setTerminalMode(TerminalMode::On); QObject::connect(proc, &QtcProcess::done, [proc] { - if (proc->error() != QProcess::UnknownError && MessageManager::instance()) - MessageManager::writeDisrupting(Tr::tr("Error starting remote shell.")); + if (proc->error() != QProcess::UnknownError && MessageManager::instance()) { + MessageManager::writeDisrupting( + Tr::tr("Error starting remote shell: %1").arg(proc->errorString())); + } proc->deleteLater(); }); @@ -492,9 +494,6 @@ void DockerDevicePrivate::startContainer() void DockerDevicePrivate::updateContainerAccess() { - if (!m_container.isEmpty()) - return; - if (DockerApi::isDockerDaemonAvailable(false).value_or(false) == false) return; |