mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 10:55:46 -05:00
[libcalamares] Special-case CalledProcessError
This commit is contained in:
parent
a0a8ab0048
commit
1e27c6438a
1 changed files with 13 additions and 0 deletions
|
@ -274,6 +274,19 @@ Helper::handleLastError()
|
|||
|
||||
if ( valMsg.isEmpty() )
|
||||
valMsg = tr( "unparseable Python error" );
|
||||
|
||||
// Special-case: CalledProcessError has an attribute "output" with the command output,
|
||||
// add that to the printed message.
|
||||
if ( typeMsg.contains( "CalledProcessError" ) )
|
||||
{
|
||||
bp::object exceptionObject( h_val );
|
||||
auto a = exceptionObject.attr( "output" );
|
||||
bp::str outputString( a );
|
||||
bp::extract< std::string > extractedOutput( outputString );
|
||||
|
||||
if ( extractedOutput.check() )
|
||||
valMsg.append( QString::fromStdString( extractedOutput() ) );
|
||||
}
|
||||
}
|
||||
|
||||
QString tbMsg;
|
||||
|
|
Loading…
Add table
Reference in a new issue