1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-04 17:49:45 +02:00

Rewrite one try-catch with GuardedCall so we can show the user errors

This commit is contained in:
Paul Licameli 2017-03-16 22:40:27 -04:00
parent 6525bb18cf
commit 01c5f25a19

View File

@ -19,6 +19,7 @@ updating the ODPCMAliasBlockFile and the GUI of the newly available data.
#include "ODComputeSummaryTask.h"
#include "../AudacityException.h"
#include "../blockfile/ODPCMAliasBlockFile.h"
#include "../Sequence.h"
#include "../WaveTrack.h"
@ -77,9 +78,10 @@ void ODComputeSummaryTask::DoSomeInternal()
{
// WriteSummary might throw, but this is a worker thread, so stop
// the exceptions here!
success = true;
try { bf->DoWriteSummary(); }
catch(...) { success = false; }
success = GuardedCall<bool>( [&] {
bf->DoWriteSummary();
return true;
} );
blockStartSample = bf->GetStart();
blockEndSample = blockStartSample + bf->GetLength();
}