From aa7a552654ba3b218b87397dedc9e5a66d2f6701 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Sun, 10 Jan 2021 23:08:07 -0500 Subject: implemented exe command better error when cwd doesn't exist --- src/spawn.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/spawn.cpp') diff --git a/src/spawn.cpp b/src/spawn.cpp index a9ecb61e..68526165 100644 --- a/src/spawn.cpp +++ b/src/spawn.cpp @@ -164,9 +164,14 @@ QString makeContent(const SpawnParameters& sp, DWORD code) } else if (code == ERROR_FILE_NOT_FOUND) { return QObject::tr("The file '%1' does not exist.") .arg(QDir::toNativeSeparators(sp.binary.absoluteFilePath())); - } else { - return QString::fromStdWString(formatSystemMessage(code)); + } else if (code == ERROR_DIRECTORY) { + if (!sp.currentDirectory.exists()) { + return QObject::tr("The working directory '%1' does not exist.") + .arg(QDir::toNativeSeparators(sp.currentDirectory.absolutePath())); + } } + + return QString::fromStdWString(formatSystemMessage(code)); } QMessageBox::StandardButton badSteamReg( -- cgit v1.3.1