Implemented 'Exception' class 'what()' method
This commit introduced 'what()' method 'Exception' class
Signed-off-by: Ivan Vagin <ivan.vagin@samsung.com>
private:
std::vector<std::string> _info;
+ mutable std::string _sInfo;
};
std::ostream &operator<<(std::ostream &s, const Exception &e);
const char *Exception::what() const throw()
{
- // TODO implement it
- throw std::runtime_error{"Not implemented, yet"};
+ _sInfo.clear();
+ for (auto it : _info)
+ _sInfo.append(it).append("\n");
+ return _sInfo.c_str();
}
const std::vector<std::string> &Exception::getInfo() const { return _info; }