mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #2567 from ethereum/refactorExceptions
Refactor exceptions and provide comment function.
This commit is contained in:
+11
-6
@@ -23,19 +23,24 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <libevmasm/SourceLocation.h>
|
||||
#include <libevmasm/Instruction.h>
|
||||
#include <libsolidity/ast/ASTForward.h>
|
||||
#include <libsolidity/parsing/Token.h>
|
||||
#include <libsolidity/ast/Types.h>
|
||||
#include <libsolidity/interface/Exceptions.h>
|
||||
#include <libsolidity/ast/ASTAnnotations.h>
|
||||
|
||||
#include <libevmasm/SourceLocation.h>
|
||||
#include <libevmasm/Instruction.h>
|
||||
|
||||
#include <libdevcore/FixedHash.h>
|
||||
#include <json/json.h>
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
namespace dev
|
||||
{
|
||||
namespace solidity
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
#include <libsolidity/interface/ErrorReporter.h>
|
||||
#include <libsolidity/interface/Exceptions.h>
|
||||
|
||||
#include <libdevcore/CommonData.h>
|
||||
|
||||
#include <boost/range/adaptor/reversed.hpp>
|
||||
|
||||
#include <memory>
|
||||
|
||||
@@ -67,16 +67,3 @@ Error::Error(Error::Type _type, const std::string& _description, const SourceLoc
|
||||
*this << errinfo_sourceLocation(_location);
|
||||
*this << errinfo_comment(_description);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user