| 35 | |
| 36 | template <typename Exception, typename Fct> |
| 37 | decltype(auto) |
| 38 | Try(Fct fct, std::function<std::string(const std::string&)> buildErrorMsg) |
| 39 | { |
| 40 | std::string error; |
| 41 | try |
| 42 | { |
| 43 | return fct(); |
| 44 | } |
| 45 | catch (const std::exception& e) |
| 46 | { |
| 47 | error = e.what(); |
| 48 | } |
| 49 | catch (...) |
| 50 | { |
| 51 | error = "Unknow"; |
| 52 | } |
| 53 | |
| 54 | throw Exception(buildErrorMsg(error)); |
| 55 | } |
| 56 | |
| 57 | TOOLS_DLL std::filesystem::path GetExecutableFolder(); |
| 58 |
nothing calls this directly
no outgoing calls
no test coverage detected