Exception.cpp 617 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::operator<<(const std::exception& e) const
  14. {
  15. Exception out(*this);
  16. out.err += "\nFrom: ";
  17. out.err += e.what();
  18. return out;
  19. }
  20. } // end namespace