Improve error handling when launching test process

* Use `EXIT_FAILURE` instead of an arbitrary exit status
* Print the error message
This commit is contained in:
Martchus 2024-01-20 17:38:14 +01:00
parent c9dea06cfe
commit c25a3c9c9a
1 changed files with 2 additions and 3 deletions

View File

@ -561,12 +561,11 @@ static int execAppInternal(const char *appPath, const char *const *args, std::st
// -> execute application
if (enableSearchPath) {
execvp(appPath, const_cast<char *const *>(args));
} else {
execv(appPath, const_cast<char *const *>(args));
}
cerr << Phrases::Error << "Unable to execute \"" << appPath << "\": execv() failed" << Phrases::EndFlush;
exit(-101);
cerr << Phrases::Error << "Unable to execute \"" << appPath << "\": " << std::strerror(errno) << Phrases::EndFlush;
exit(EXIT_FAILURE);
}
#else