CoreUtils/Exception.cpp

19 lines
416 B
C++
Raw Permalink Normal View History

2019-09-13 10:29:36 -07:00
#include "Exception.h"
#include "Log.h"
namespace coreutils {
2021-08-11 21:37:48 -07:00
2019-09-13 10:29:36 -07:00
Exception::Exception(std::string text, std::string file, int line, int errorNumber) {
this->text = text;
this->file = file;
this->line = line;
if(errorNumber == -1)
2021-08-11 21:37:48 -07:00
this->errorNumber = errno;
2019-09-13 10:29:36 -07:00
else
2021-08-11 21:37:48 -07:00
this->errorNumber = errorNumber;
2023-03-10 12:55:08 -08:00
Log(LOG_EXCEPT) << text << "(" << file << ":" << line << ")";
2019-09-13 10:29:36 -07:00
}
}