| 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 | |
| 1411 | namespace detail { |
no test coverage detected