mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-17 16:11:11 +02:00
Rewrite one try-catch with GuardedCall so we can show the user errors
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user