[libcalamares] Improve reporting of CalledProcessError

For called processes, replace the not-very-useful type message
with the command-explanation, and replace the value (previously
command-explanation) by the stderr of the failed command.

FIXES #865
main
Adriaan de Groot 7 years ago
parent 9df796a3fd
commit cc195eb3d4

@ -288,8 +288,18 @@ Helper::handleLastError()
bp::str outputString( a ); bp::str outputString( a );
bp::extract< std::string > extractedOutput( outputString ); bp::extract< std::string > extractedOutput( outputString );
QString output;
if ( extractedOutput.check() ) if ( extractedOutput.check() )
valMsg.append( QString::fromStdString( extractedOutput() ) ); {
output = QString::fromStdString( extractedOutput() ).trimmed();
}
if ( !output.isEmpty() )
{
// Replace the Type of the error by the warning string,
// and use the output of the command (e.g. its stderr) as value.
typeMsg = valMsg;
valMsg = output;
}
} }
debug << valMsg << '\n'; debug << valMsg << '\n';
} }
@ -323,7 +333,7 @@ Helper::handleLastError()
if ( !tbMsg.isEmpty() ) if ( !tbMsg.isEmpty() )
{ {
msgList.append( "Traceback:" ); msgList.append( QStringLiteral( "<br/>Traceback:" ) );
msgList.append( QString( "<pre>%1</pre>" ).arg( tbMsg.toHtmlEscaped() ) ); msgList.append( QString( "<pre>%1</pre>" ).arg( tbMsg.toHtmlEscaped() ) );
} }

Loading…
Cancel
Save