MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / translateActiveException

Function translateActiveException

tests/framework/src/doctest.cpp:1383–1408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1381 }
1382
1383 String translateActiveException() {
1384#ifndef DOCTEST_CONFIG_NO_EXCEPTIONS
1385 String res;
1386 auto& translators = getExceptionTranslators();
1387 for(auto& curr : translators)
1388 if(curr->translate(res))
1389 return res;
1390 // clang-format off
1391 DOCTEST_GCC_SUPPRESS_WARNING_WITH_PUSH("-Wcatch-value")
1392 try {
1393 throw;
1394 } catch(std::exception& ex) {
1395 return ex.what();
1396 } catch(std::string& msg) {
1397 return msg.c_str();
1398 } catch(const char* msg) {
1399 return msg;
1400 } catch(...) {
1401 return "unknown exception";
1402 }
1403 DOCTEST_GCC_SUPPRESS_WARNING_POP
1404// clang-format on
1405#else // DOCTEST_CONFIG_NO_EXCEPTIONS
1406 return "";
1407#endif // DOCTEST_CONFIG_NO_EXCEPTIONS
1408 }
1409} // namespace
1410
1411namespace detail {

Callers 2

translateExceptionMethod · 0.85
runMethod · 0.85

Calls 3

translateMethod · 0.45
whatMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected