ougge/src/UsefulException.cpp
2024-07-30 01:02:42 +03:00

16 lines
482 B
C++

#include "UsefulException.hpp"
#include <sstream>
UsefulException_::UsefulException_(const std::string& _message, const std::string& _file, const std::string& _func, int _line_n)
: message(_message), file(_file), function(_func), line_n(_line_n)
{
std::stringstream ss;
ss<<message<<'\n';
ss<<" at "<<file<<':'<<_line_n<<" in "<<function;
complete_text = ss.str();
}
char const* UsefulException_::what() const noexcept {
return complete_text.c_str();
}