🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
585 B

  1. #include "config.h"
  2. #include "eax_utils.h"
  3. #include <cassert>
  4. #include <exception>
  5. #include "core/logging.h"
  6. void eax_log_exception(
  7. const char* message) noexcept
  8. {
  9. const auto exception_ptr = std::current_exception();
  10. assert(exception_ptr);
  11. if (message)
  12. {
  13. ERR("%s\n", message);
  14. }
  15. try
  16. {
  17. std::rethrow_exception(exception_ptr);
  18. }
  19. catch (const std::exception& ex)
  20. {
  21. const auto ex_message = ex.what();
  22. ERR("%s\n", ex_message);
  23. }
  24. catch (...)
  25. {
  26. ERR("%s\n", "Generic exception.");
  27. }
  28. }