MCPcopy Create free account
hub / github.com/OpenCppCoverage/OpenCppCoverage / Try

Function Try

Tools/Tool.cpp:119–135  ·  view source on GitHub ↗

-------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

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(

Callers 2

~ScopedActionMethod · 0.70
~HandleMethod · 0.50

Calls 1

LocalToWStringFunction · 0.85

Tested by

no test coverage detected