If an exception throws out of an IC, catch it & add to the report file instead of just falling over.
This commit is contained in:
parent
2fc9faaee1
commit
b26422fa07
|
@ -254,15 +254,12 @@ int __cdecl _tmain( int argc, const TCHAR* argv[ ], const TCHAR* envp[ ] )
|
||||||
TCERR << _T("*** Exiting...\n");
|
TCERR << _T("*** Exiting...\n");
|
||||||
ret = 8;
|
ret = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
TCERR << _T("*** Fatal exception occurred.\n");
|
TCERR << _T("*** Fatal exception occurred.\n");
|
||||||
TCERR << _T("*** Exiting...\n");
|
TCERR << _T("*** Exiting...\n");
|
||||||
ret = 8;
|
ret = 8;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
|
||||||
|
|
|
@ -709,6 +709,7 @@ int cTWModeDbInit::Execute(cErrorQueue* pQueue)
|
||||||
// generate the database...
|
// generate the database...
|
||||||
// TODO -- turn pQueue into an error bucket
|
// TODO -- turn pQueue into an error bucket
|
||||||
cGenerateDb::Execute( dbIter.GetSpecList(), dbIter.GetDb(), dbIter.GetGenreHeader().GetPropDisplayer(), pQueue, gdbFlags );
|
cGenerateDb::Execute( dbIter.GetSpecList(), dbIter.GetDb(), dbIter.GetGenreHeader().GetPropDisplayer(), pQueue, gdbFlags );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cFCODatabaseUtil::CalculateHeader(
|
cFCODatabaseUtil::CalculateHeader(
|
||||||
|
@ -1150,15 +1151,35 @@ int cTWModeIC::Execute(cErrorQueue* pQueue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO -- emit "processing XXX"
|
// TODO -- emit "processing XXX"
|
||||||
|
|
||||||
cIntegrityCheck ic( (cGenre::Genre)genreIter->first, dbIter.GetSpecList(), dbIter.GetDb(), report, pQueue );
|
cIntegrityCheck ic( (cGenre::Genre)genreIter->first, dbIter.GetSpecList(), dbIter.GetDb(), report, pQueue );
|
||||||
|
|
||||||
|
//If any sort of exception escapes the IC, make sure it goes in the report.
|
||||||
|
try
|
||||||
|
{
|
||||||
uint32 icFlags = 0;
|
uint32 icFlags = 0;
|
||||||
icFlags |= ( mpData->mfLooseDirs ? cIntegrityCheck::FLAG_LOOSE_DIR : 0 );
|
icFlags |= ( mpData->mfLooseDirs ? cIntegrityCheck::FLAG_LOOSE_DIR : 0 );
|
||||||
icFlags |= ( mpData->mbResetAccessTime ? cIntegrityCheck::FLAG_ERASE_FOOTPRINTS_IC : 0 );
|
icFlags |= ( mpData->mbResetAccessTime ? cIntegrityCheck::FLAG_ERASE_FOOTPRINTS_IC : 0 );
|
||||||
icFlags |= ( mpData->mbDirectIO ? cIntegrityCheck::FLAG_DIRECT_IO : 0 );
|
icFlags |= ( mpData->mbDirectIO ? cIntegrityCheck::FLAG_DIRECT_IO : 0 );
|
||||||
|
|
||||||
ic.ExecuteOnObjectList( fcoNames, icFlags );
|
ic.ExecuteOnObjectList( fcoNames, icFlags );
|
||||||
|
}
|
||||||
|
catch( eError& e )
|
||||||
|
{
|
||||||
|
if( pQueue )
|
||||||
|
pQueue->AddError(e);
|
||||||
|
}
|
||||||
|
catch( std::exception& e )
|
||||||
|
{
|
||||||
|
if (pQueue )
|
||||||
|
pQueue->AddError(eIC(e.what()));
|
||||||
|
}
|
||||||
|
catch(...)
|
||||||
|
{
|
||||||
|
if (pQueue )
|
||||||
|
pQueue->AddError(eIC("Unknown"));
|
||||||
|
|
||||||
|
}
|
||||||
// put all info into report
|
// put all info into report
|
||||||
cFCOReportGenreIter rgi( report );
|
cFCOReportGenreIter rgi( report );
|
||||||
rgi.SeekToGenre( (cGenre::Genre) genreIter->first );
|
rgi.SeekToGenre( (cGenre::Genre) genreIter->first );
|
||||||
|
@ -1284,12 +1305,31 @@ int cTWModeIC::Execute(cErrorQueue* pQueue)
|
||||||
#endif
|
#endif
|
||||||
cIntegrityCheck ic( (cGenre::Genre)dbIter.GetGenre(), specList, dbIter.GetDb(), report, pQueue );
|
cIntegrityCheck ic( (cGenre::Genre)dbIter.GetGenre(), specList, dbIter.GetDb(), report, pQueue );
|
||||||
|
|
||||||
|
//If any sort of exception escapes the IC, make sure it goes in the report.
|
||||||
|
try
|
||||||
|
{
|
||||||
uint32 icFlags = 0;
|
uint32 icFlags = 0;
|
||||||
icFlags |= ( mpData->mfLooseDirs ? cIntegrityCheck::FLAG_LOOSE_DIR : 0 );
|
icFlags |= ( mpData->mfLooseDirs ? cIntegrityCheck::FLAG_LOOSE_DIR : 0 );
|
||||||
icFlags |= ( mpData->mbResetAccessTime ? cIntegrityCheck::FLAG_ERASE_FOOTPRINTS_IC : 0 );
|
icFlags |= ( mpData->mbResetAccessTime ? cIntegrityCheck::FLAG_ERASE_FOOTPRINTS_IC : 0 );
|
||||||
icFlags |= ( mpData->mbDirectIO ? cIntegrityCheck::FLAG_DIRECT_IO : 0 );
|
icFlags |= ( mpData->mbDirectIO ? cIntegrityCheck::FLAG_DIRECT_IO : 0 );
|
||||||
|
|
||||||
ic.Execute( icFlags );
|
ic.Execute( icFlags );
|
||||||
|
}
|
||||||
|
catch( eError& e )
|
||||||
|
{
|
||||||
|
if( pQueue )
|
||||||
|
pQueue->AddError(e);
|
||||||
|
}
|
||||||
|
catch( std::exception& e )
|
||||||
|
{
|
||||||
|
if (pQueue )
|
||||||
|
pQueue->AddError(eIC(e.what()));
|
||||||
|
}
|
||||||
|
catch(...)
|
||||||
|
{
|
||||||
|
if (pQueue )
|
||||||
|
pQueue->AddError(eIC("Unknown"));
|
||||||
|
}
|
||||||
|
|
||||||
// put all display info into report
|
// put all display info into report
|
||||||
cFCOReportGenreIter rgi( report );
|
cFCOReportGenreIter rgi( report );
|
||||||
|
|
Loading…
Reference in New Issue