summaryrefslogtreecommitdiff
path: root/src/core/common/Exceptions.cpp
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-01 15:10:31 +0100
committerAndreas Stöckel <andreas@somweyr.de>2015-01-01 15:10:31 +0100
commit347d5366356f254284f742772095fd4fd1092be8 (patch)
tree7360de11df3450bd058f89a378ee17dc4869c383 /src/core/common/Exceptions.cpp
parentb36c695f216588b444ba511fbe1733fb112ab3d9 (diff)
Adapted LoggableException class to new Location types
Diffstat (limited to 'src/core/common/Exceptions.cpp')
-rw-r--r--src/core/common/Exceptions.cpp14
1 files changed, 5 insertions, 9 deletions
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();
}
}