--- PatchGenerator.cpp.old 2007-08-28 17:22:14.000000000 -0300 +++ PatchGenerator.cpp 2008-09-11 16:28:58.553382100 -0300 @@ -54,26 +54,34 @@ const QString GENPAT_EXE( "GenPat.exe" ); + QProcess genPat; + qDebug( "Creating patch file: %s", patchFile.toAscii().constData() ); createDirectoryForPatchFileIfNecessary( patchFile ); - QProcess genPat; genPat.start( GENPAT_EXE, arguments ); - if( genPat.error() == QProcess::FailedToStart || - genPat.error() == QProcess::Crashed ) - { - throw QString( "GenPat failed to start" ); - } - - const int MSECS_IN_MIN = 60 * 1000; + const int MSECS_IN_MIN = 60 * 1000; const int TIMEOUT_SECS = 60 * MSECS_IN_MIN; // 60 mins - if( ! genPat.waitForFinished( TIMEOUT_SECS ) ) + if( ! genPat.waitForFinished( TIMEOUT_SECS ) ) { - throw( QString( "Timed out waiting on GenPat") ); - } + switch (genPat.error()) { + case QProcess::FailedToStart: + throw QString( "The process failed to start. Either the invoked program is missing, or you may have insufficient permissions to invoke the program." ); + case QProcess::Crashed: + throw QString( "The process crashed some time after starting successfully."); + case QProcess::Timedout: + throw QString( "The last waitFor...() function timed out. The state of QProcess is unchanged, and you can try calling waitFor...() again."); + case QProcess::WriteError: + throw QString( "An error occurred when attempting to write to the process. For example, the process may not be running, or it may have closed its input channel."); + case QProcess::ReadError: + throw QString( "An error occurred when attempting to read from the process. For example, the process may not be running."); + case QProcess::UnknownError: + throw QString( "An unknown error occurred. This is the default return value of error()."); + } + } switch( genPat.exitCode( ) ) {