From 4abb87ccca33e8110315fa791df5c39e0012634d Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 6 Apr 2020 11:17:47 +0200 Subject: [PATCH] [libcalamares] Improve reporting on process failures - In production, cDebug() might not show up, so the log will not contain the lines saying what program is being run; - Errors should at least mention the program name, but "env" or "chroot" is not useful, so pull that from *args*, which is the command we actually want to run. --- src/libcalamares/utils/CalamaresUtilsSystem.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libcalamares/utils/CalamaresUtilsSystem.cpp b/src/libcalamares/utils/CalamaresUtilsSystem.cpp index d2f331919..f70de8ea2 100644 --- a/src/libcalamares/utils/CalamaresUtilsSystem.cpp +++ b/src/libcalamares/utils/CalamaresUtilsSystem.cpp @@ -181,7 +181,7 @@ System::runCommand( System::RunLocation location, process.start(); if ( !process.waitForStarted() ) { - cWarning() << "Process failed to start" << process.error(); + cWarning() << "Process" << args.first() << "failed to start" << process.error(); return ProcessResult::Code::FailedToStart; } @@ -195,7 +195,7 @@ System::runCommand( System::RunLocation location, ? ( static_cast< int >( std::chrono::milliseconds( timeoutSec ).count() ) ) : -1 ) ) { - cWarning().noquote().nospace() << "Timed out. Output so far:\n" << process.readAllStandardOutput(); + cWarning().noquote().nospace() << "Process" << args.first() << "timed out. Output so far:\n" << process.readAllStandardOutput(); return ProcessResult::Code::TimedOut; } @@ -203,7 +203,7 @@ System::runCommand( System::RunLocation location, if ( process.exitStatus() == QProcess::CrashExit ) { - cWarning().noquote().nospace() << "Process crashed. Output so far:\n" << output; + cWarning().noquote().nospace() << "Process" << args.first() << "crashed. Output so far:\n" << output; return ProcessResult::Code::Crashed; }