aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2017-02-15 21:52:53 +0800
committerchriseth <c@ethdev.com>2017-03-03 22:41:01 +0800
commit7f2def89715a7ec663afa0e7342d6a4fa8d5b316 (patch)
tree2a24a61ed806e2910cae51412135ba3e02eed100 /libsolidity/interface
parent98e343b3fc11f3e94297b016c3f625e3b319b09b (diff)
downloaddexon-solidity-7f2def89715a7ec663afa0e7342d6a4fa8d5b316.tar.gz
dexon-solidity-7f2def89715a7ec663afa0e7342d6a4fa8d5b316.tar.zst
dexon-solidity-7f2def89715a7ec663afa0e7342d6a4fa8d5b316.zip
Analysis refactoring.
Diffstat (limited to 'libsolidity/interface')
-rw-r--r--libsolidity/interface/Exceptions.cpp8
-rw-r--r--libsolidity/interface/Exceptions.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/libsolidity/interface/Exceptions.cpp b/libsolidity/interface/Exceptions.cpp
index 41890b91..20f9dd75 100644
--- a/libsolidity/interface/Exceptions.cpp
+++ b/libsolidity/interface/Exceptions.cpp
@@ -58,6 +58,14 @@ Error::Error(Type _type): m_type(_type)
}
}
+Error::Error(Error::Type _type, const std::string& _description, const SourceLocation& _location):
+ Error(_type)
+{
+ if (!_location.isEmpty())
+ *this << errinfo_sourceLocation(_location);
+ *this << errinfo_comment(_description);
+}
+
string Exception::lineInfo() const
{
char const* const* file = boost::get_error_info<boost::throw_file>(*this);
diff --git a/libsolidity/interface/Exceptions.h b/libsolidity/interface/Exceptions.h
index 81716c41..71699da8 100644
--- a/libsolidity/interface/Exceptions.h
+++ b/libsolidity/interface/Exceptions.h
@@ -55,6 +55,8 @@ public:
explicit Error(Type _type);
+ Error(Type _type, std::string const& _description, SourceLocation const& _location = SourceLocation());
+
Type type() const { return m_type; }
std::string const& typeName() const { return m_typeName; }