mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-29 08:43:56 +01: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 "ODComputeSummaryTask.h"
|
||||||
|
#include "../AudacityException.h"
|
||||||
#include "../blockfile/ODPCMAliasBlockFile.h"
|
#include "../blockfile/ODPCMAliasBlockFile.h"
|
||||||
#include "../Sequence.h"
|
#include "../Sequence.h"
|
||||||
#include "../WaveTrack.h"
|
#include "../WaveTrack.h"
|
||||||
@@ -77,9 +78,10 @@ void ODComputeSummaryTask::DoSomeInternal()
|
|||||||
{
|
{
|
||||||
// WriteSummary might throw, but this is a worker thread, so stop
|
// WriteSummary might throw, but this is a worker thread, so stop
|
||||||
// the exceptions here!
|
// the exceptions here!
|
||||||
success = true;
|
success = GuardedCall<bool>( [&] {
|
||||||
try { bf->DoWriteSummary(); }
|
bf->DoWriteSummary();
|
||||||
catch(...) { success = false; }
|
return true;
|
||||||
|
} );
|
||||||
blockStartSample = bf->GetStart();
|
blockStartSample = bf->GetStart();
|
||||||
blockEndSample = blockStartSample + bf->GetLength();
|
blockEndSample = blockStartSample + bf->GetLength();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user