[libcalamares] Special-case CalledProcessError

This commit is contained in:
Adriaan de Groot 2017-11-28 11:21:42 -05:00
parent a0a8ab0048
commit 1e27c6438a

View File

@ -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;