nstool/lib/libfnd/source/Exception.cpp

49 lines
702 B
C++
Raw Normal View History

#include <fnd/Exception.h>
2017-07-02 15:18:59 +00:00
using namespace fnd;
Exception::Exception() noexcept :
what_(""),
module_(""),
error_("")
2017-07-02 15:18:59 +00:00
{
}
Exception::Exception(const std::string & what) noexcept :
what_(what),
module_(""),
error_(what)
2017-07-02 15:18:59 +00:00
{
}
Exception::Exception(const std::string & module, const std::string & what) noexcept :
what_(""),
2017-07-02 15:18:59 +00:00
module_(module),
error_(what)
2017-07-02 15:18:59 +00:00
{
if (module_.length() > 0)
{
what_ = "[" + module_ + " ERROR] " + error_;
}
else
{
what_ = error_;
}
2017-07-02 15:18:59 +00:00
}
const char* Exception::what() const noexcept
{
return what_.c_str();
}
const char* Exception::module() const noexcept
{
return module_.c_str();
}
const char * fnd::Exception::error() const noexcept
2017-07-02 15:18:59 +00:00
{
return nullptr;
2017-07-02 15:18:59 +00:00
}