mirror of
https://github.com/edubart/otclient.git
synced 2026-01-11 08:31:29 +01:00
merge total remake
This commit is contained in:
25
src/framework/otml/otmlexception.cpp
Normal file
25
src/framework/otml/otmlexception.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "otmlexception.h"
|
||||
#include "otmldocument.h"
|
||||
|
||||
OTMLException::OTMLException(const OTMLNodePtr& node, const std::string& error)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "OTML error";
|
||||
if(!node->source().empty())
|
||||
ss << " in '" << node->source() << "'";
|
||||
ss << ": " << error;
|
||||
m_what = ss.str();
|
||||
}
|
||||
|
||||
OTMLException::OTMLException(const OTMLDocumentPtr& doc, const std::string& error, int line)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "OTML error";
|
||||
if(doc && !doc->source().empty()) {
|
||||
ss << " in '" << doc->source() << "'";
|
||||
if(line >= 0)
|
||||
ss << " at line " << line;
|
||||
}
|
||||
ss << ": " << error;
|
||||
m_what = ss.str();
|
||||
}
|
||||
Reference in New Issue
Block a user