2017-07-02 15:18:59 +00:00
|
|
|
#include "exception.h"
|
|
|
|
|
|
|
|
using namespace fnd;
|
|
|
|
|
|
|
|
Exception::Exception() noexcept :
|
|
|
|
what_(""),
|
|
|
|
module_(""),
|
2017-07-07 09:57:38 +00:00
|
|
|
error_("")
|
2017-07-02 15:18:59 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Exception::Exception(const std::string & what) noexcept :
|
|
|
|
what_(what),
|
|
|
|
module_(""),
|
2017-07-07 09:57:38 +00:00
|
|
|
error_(what)
|
2017-07-02 15:18:59 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Exception::Exception(const std::string & module, const std::string & what) noexcept :
|
2017-07-07 09:57:38 +00:00
|
|
|
what_(""),
|
2017-07-02 15:18:59 +00:00
|
|
|
module_(module),
|
2017-07-07 09:57:38 +00:00
|
|
|
error_(what)
|
2017-07-02 15:18:59 +00:00
|
|
|
{
|
2017-07-07 09:57:38 +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();
|
|
|
|
}
|
|
|
|
|
2017-07-07 09:57:38 +00:00
|
|
|
const char * fnd::Exception::error() const noexcept
|
2017-07-02 15:18:59 +00:00
|
|
|
{
|
2017-07-07 09:57:38 +00:00
|
|
|
return nullptr;
|
2017-07-02 15:18:59 +00:00
|
|
|
}
|