1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
11 #include <anna/core/RuntimeException.hpp>
12 #include <anna/core/tracing/Logger.hpp>
16 Exception::Exception(const char* text, const char* name, const char* fromFile, const int fromLine) :
20 m_fromFile = fromFile;
21 m_fromLine = fromLine;
24 Exception::Exception(const char* text, const char* fromFile, const int fromLine) :
28 m_fromFile = fromFile;
29 m_fromLine = fromLine;
32 Exception::Exception(const Exception& other) {
33 m_text = other.m_text;
34 m_name = other.m_name;
35 m_fromFile = other.m_fromFile;
36 m_fromLine = other.m_fromLine;
37 m_errorCode = other.m_errorCode;
40 //-----------------------------------------------------------------------
42 //-----------------------------------------------------------------------
43 Exception& Exception::operator = (const Exception & other)
46 m_name = other.m_name;
47 m_text = other.m_text;
48 m_fromFile = other.m_fromFile;
49 m_fromLine = other.m_fromLine;
50 m_errorCode = other.m_errorCode;
56 std::string Exception::asString() const
60 sprintf(n, " (%d) ] ", m_fromLine);
70 void Exception::trace() const
72 Logger::write(Logger::Error, m_name.c_str(), m_text.c_str(), m_fromFile.c_str(), m_fromLine); // JEDS 24/09/2003