27 bool SafeRunnable::ignoreErrors =
false;
30 class DefaultSafeRunnableRunner:
public ISafeRunnableRunner
40 catch (
const ctkException& e)
42 HandleException(code, e);
44 catch (
const std::exception& e)
46 HandleException(code, e);
50 HandleException(code);
58 HandleException(code, ctkException(
"Unknown exception thrown"));
62 const std::exception& e)
64 HandleException(code, ctkException(e.what()));
71 static_cast<void>(
dynamic_cast<const OperationCanceledException&
> (e));
73 catch (
const std::bad_cast&)
83 qDebug() << e.printStackTrace();
91 code->HandleException(e);
95 SmartPointer<ISafeRunnableRunner> SafeRunnable::CreateDefaultRunner()
114 if (message.isEmpty())
115 message =
"An error has occurred. See error log for more details.";
138 runner = CreateDefaultRunner();
145 SafeRunnable::runner = runner;
static bool GetIgnoreErrors()
berry::SmartPointer< Self > Pointer
static ISafeRunnableRunner::Pointer GetRunner()
Implements transparent reference counting.
static void SetIgnoreErrors(bool flag)
berry::SmartPointer< Self > Pointer
SafeRunnable(const QString &message="")
static void SetRunner(ISafeRunnableRunner::Pointer runner)
void HandleException(const ctkException &e) override