1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-21 14:02:57 +02:00

Exception framework: define AudacityException and GuardedCall...

AudacityException is an abstract base class for exceptions generated by
Audacity.

GuardedCall wraps any function (usually a lambda) in an appropriate catch
block.

It can also accept a second function that defines a catch block action, which
can rethrow or return a value for the GuardedCall.

It can also accept a third function, that defines another, delayed action that
executes in the main thread at idle time if the second function intercepts an
AudacityException and completes without rethrow.

Defaults for the second function simply return void or false.  Default for the
third function invokes a virtual method of AudacityException, which for
subclass MessageBoxException, displays a message box.
This commit is contained in:
Paul Licameli
2016-11-22 14:54:20 -05:00
parent 26f917b1fd
commit df077d171a
6 changed files with 268 additions and 2 deletions

View File

@@ -101,6 +101,8 @@ audacity_SOURCES = \
Audacity.h \
AudacityApp.cpp \
AudacityApp.h \
AudacityException.cpp \
AudacityException.h \
AudacityLogger.cpp \
AudacityLogger.h \
AudioIO.cpp \