23 std::exception_ptr pException,
27 pException = std::move(pException), delayedHandler = std::move(delayedHandler)
30 std::rethrow_exception(pException);
33 { delayedHandler( &e ); }
41 : caption { caption_ }
42 , exceptionType { exceptionType_ }
100 .IconStyle(Icon::Error) );
105 ? ErrorDialogType::ModalErrorReport : ErrorDialogType::ModalError;
wxAtomicInt sOutstandingMessages
Declare abstract class AudacityException, some often-used subclasses, and GuardedCall.
ExceptionType
A type of an exception.
@ Internal
Indicates internal failure from Audacity.
Toolkit-neutral facade for basic user interface services.
Base class for exceptions specially processed by the application.
static void EnqueueAction(std::exception_ptr pException, std::function< void(AudacityException *)> delayedHandler)
virtual ~AudacityException()=0
Abstract AudacityException subclass displays a message, specified by further subclass.
bool moved
Whether *this has been the source of a copy.
virtual TranslatableString ErrorMessage() const =0
Format the error message for this exception.
void DelayedHandlerAction() final
Do not allow subclasses to change behavior, except by overriding ErrorMessage().
virtual wxString ErrorHelpUrl() const
~MessageBoxException() override
MessageBoxException(ExceptionType exceptionType, const TranslatableString &caption)
If default-constructed with empty caption, it makes no message box.
TranslatableString caption
Stored caption.
ExceptionType exceptionType
Exception type.
virtual TranslatableString ErrorMessage() const override
Format the error message for this exception.
TranslatableString message
Stored message.
~SimpleMessageBoxException() override
Holds a msgid for the translation catalog; may also bind format arguments.
TranslatableString DefaultCaption()
"Message", suitably translated
void CallAfter(Action action)
Schedule an action to be done later, and in the main thread.
void ShowErrorDialog(const WindowPlacement &placement, const TranslatableString &dlogTitle, const TranslatableString &message, const ManualPageID &helpPage, const ErrorDialogOptions &options={})
Show an error dialog with a link to the manual for further help.
MessageBoxResult ShowMessageBox(const TranslatableString &message, MessageBoxOptions options={})
Show a modal message box with either Ok or Yes and No, and optionally Cancel.
Options for variations of error dialogs; the default is for modal dialogs.
MessageBoxOptions && Caption(TranslatableString caption_) &&