diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-12-11 20:59:56 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-12-11 21:00:34 +0000 |
commit | ee037deada8ee2ac09f58f9fdc47d0ca904b3b7f (patch) | |
tree | 4d12f3a599f7a0ad9b5771a791b56cf067525b67 /vcl | |
parent | d4b7bd9966f20cb34932970b6d34c901fa733bef (diff) |
coverity#1257738 Uncaught exception
Change-Id: I44648fb951d03090759d8afaa20cab7d945f684d
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/workben/mtfdemo.cxx | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/vcl/workben/mtfdemo.cxx b/vcl/workben/mtfdemo.cxx index fc98d1cc56e8..9e76737566ff 100644 --- a/vcl/workben/mtfdemo.cxx +++ b/vcl/workben/mtfdemo.cxx @@ -87,13 +87,25 @@ public: virtual int Main() SAL_OVERRIDE { - mpWin = new DemoMtfWin(*mpFileName); - mpWin->SetText(OUString("Display metafile")); - - mpWin->Show(); + try + { + mpWin = new DemoMtfWin(*mpFileName); + mpWin->SetText(OUString("Display metafile")); - Application::Execute(); + mpWin->Show(); + Application::Execute(); + } + catch (const css::uno::Exception& e) + { + SAL_WARN("vcl.app", "Fatal exception: " << e.Message); + return 1; + } + catch (const std::exception& e) + { + SAL_WARN("vcl.app", "Fatal exception: " << e.what()); + return 1; + } return 0; } |