aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/interface')
-rw-r--r--libsolidity/interface/Exceptions.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/libsolidity/interface/Exceptions.cpp b/libsolidity/interface/Exceptions.cpp
index 90a680b4..41890b91 100644
--- a/libsolidity/interface/Exceptions.cpp
+++ b/libsolidity/interface/Exceptions.cpp
@@ -23,6 +23,7 @@
#include <libsolidity/interface/Exceptions.h>
#include <libsolidity/interface/Utils.h>
+using namespace std;
using namespace dev;
using namespace dev::solidity;
@@ -56,3 +57,16 @@ Error::Error(Type _type): m_type(_type)
break;
}
}
+
+string Exception::lineInfo() const
+{
+ char const* const* file = boost::get_error_info<boost::throw_file>(*this);
+ int const* line = boost::get_error_info<boost::throw_line>(*this);
+ string ret;
+ if (file)
+ ret += *file;
+ ret += ':';
+ if (line)
+ ret += boost::lexical_cast<string>(*line);
+ return ret;
+}