Exception.cpp 696 B

12345678910111213141516171819202122232425262728
  1. #include "anki/util/Exception.h"
  2. #include <sstream>
  3. namespace anki {
  4. //==============================================================================
  5. std::string Exception::synthErr(const char* error, const char* file,
  6. int line, const char* func)
  7. {
  8. std::stringstream ss;
  9. ss << "(" << file << ':' << line << ' ' << func << ") " << error;
  10. return ss.str();
  11. }
  12. //==============================================================================
  13. Exception::Exception(const char* err, const std::exception& e,
  14. const char* file, int line, const char* func)
  15. {
  16. std::stringstream ss;
  17. ss << synthErr(error, file, line, func) << ". From here:\n" << e.what();
  18. err = ss.str();
  19. }
  20. } // end namespace