SLProject  4.3.020
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SENSException.h
Go to the documentation of this file.
1 #ifndef SENS_EXCEPTION_H
2 #define SENS_EXCEPTION_H
3 
4 #include <exception>
5 #include <string>
6 #include <sstream>
7 #include "SENS.h"
8 
9 class SENSException : public std::runtime_error
10 {
11 public:
12  SENSException(SENSType type, const std::string& msg, const int line, const std::string& file)
13  : std::runtime_error(toMessage(msg, line, file).c_str())
14  {
15  }
16 
17 private:
18  std::string toMessage(const std::string& msg, const int line, const std::string& file)
19  {
20  std::stringstream ss;
21  ss << msg << ": Exception thrown at line " << line << " in " << file << std::endl;
22  return ss.str();
23  }
24 };
25 
26 #endif //SENS_EXCEPTION_H
SENSType
Definition: SENS.h:49
SENSException(SENSType type, const std::string &msg, const int line, const std::string &file)
Definition: SENSException.h:12
std::string toMessage(const std::string &msg, const int line, const std::string &file)
Definition: SENSException.h:18