mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-25 16:38:21 -04:00
[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
This commit is contained in:
parent
9df796a3fd
commit
cc195eb3d4
1 changed files with 12 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue