diff options
Diffstat (limited to 'libsolidity/interface')
-rw-r--r-- | libsolidity/interface/Exceptions.cpp | 8 | ||||
-rw-r--r-- | libsolidity/interface/Exceptions.h | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/libsolidity/interface/Exceptions.cpp b/libsolidity/interface/Exceptions.cpp index 406ebbfb..968a24ad 100644 --- a/libsolidity/interface/Exceptions.cpp +++ b/libsolidity/interface/Exceptions.cpp @@ -64,6 +64,14 @@ Error::Error(Type _type, SourceLocation const& _location, string const& _descrip *this << errinfo_comment(_description); } +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 f4b9fd59..0803d8cc 100644 --- a/libsolidity/interface/Exceptions.h +++ b/libsolidity/interface/Exceptions.h @@ -59,6 +59,8 @@ public: std::string const& _description = std::string() ); + 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; } |