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