From 347d5366356f254284f742772095fd4fd1092be8 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Thu, 1 Jan 2015 15:10:31 +0100 Subject: Adapted LoggableException class to new Location types --- src/core/common/Exceptions.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/core/common/Exceptions.cpp') diff --git a/src/core/common/Exceptions.cpp b/src/core/common/Exceptions.cpp index 30c5626..e368b5a 100644 --- a/src/core/common/Exceptions.cpp +++ b/src/core/common/Exceptions.cpp @@ -25,21 +25,17 @@ namespace ousia { /* Class LoggableException */ std::string LoggableException::formatMessage(const std::string &msg, - const TextCursor::Position &pos, - const TextCursor::Context &ctx) + const SourceLocation &loc) { std::stringstream ss; ss << "error "; - if (pos.hasLine()) { - ss << "at line " << pos.line << ", "; - if (pos.hasColumn()) { - ss << "column " << pos.column << " "; + if (loc.hasLine()) { + ss << "at line " << loc.line << ", "; + if (loc.hasColumn()) { + ss << "column " << loc.column << " "; } } ss << "with message: " << msg; - if (ctx.valid()) { - ss << " in context \"" << ctx.text << "\""; - } return ss.str(); } } -- cgit v1.2.3