mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-21 22:12:58 +02:00
Intercept exceptions in command script, report failure.
This commit is contained in:
@@ -20,6 +20,7 @@ ApplyAndSendResponse, and CommandImplementation classes
|
||||
#include <wx/variant.h>
|
||||
#include <wx/arrstr.h>
|
||||
|
||||
#include "../AudacityException.h"
|
||||
#include "Validators.h"
|
||||
#include "CommandType.h"
|
||||
#include "CommandMisc.h"
|
||||
@@ -71,7 +72,9 @@ bool DecoratedCommand::SetParameter(const wxString ¶mName,
|
||||
|
||||
bool ApplyAndSendResponse::Apply(CommandExecutionContext context)
|
||||
{
|
||||
bool result = mCommand->Apply(context);
|
||||
auto result = GuardedCall<bool>(
|
||||
[&] { return mCommand->Apply(context); }
|
||||
);
|
||||
wxString response = GetName();
|
||||
// These three strings are deliberately not localised.
|
||||
// They are used in script responses and always happen in English.
|
||||
|
Reference in New Issue
Block a user