-------------------------------------------------------------------------
| 117 | |
| 118 | //------------------------------------------------------------------------- |
| 119 | boost::optional<std::wstring> Try(std::function<void()> action) |
| 120 | { |
| 121 | try |
| 122 | { |
| 123 | action(); |
| 124 | } |
| 125 | catch (const std::exception& e) |
| 126 | { |
| 127 | return Tools::LocalToWString(e.what()); |
| 128 | } |
| 129 | catch (...) |
| 130 | { |
| 131 | return std::wstring{L"Unkown exception"}; |
| 132 | } |
| 133 | |
| 134 | return boost::none; |
| 135 | } |
| 136 | |
| 137 | //------------------------------------------------------------------------- |
| 138 | void ShowOutputMessage( |
no test coverage detected