mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Error constructor.
This commit is contained in:
parent
c89a579809
commit
960b5fa032
@ -27,7 +27,8 @@ using namespace std;
|
|||||||
using namespace dev;
|
using namespace dev;
|
||||||
using namespace dev::solidity;
|
using namespace dev::solidity;
|
||||||
|
|
||||||
Error::Error(Type _type): m_type(_type)
|
Error::Error(Type _type, SourceLocation const& _location, string const& _description):
|
||||||
|
m_type(_type)
|
||||||
{
|
{
|
||||||
switch(m_type)
|
switch(m_type)
|
||||||
{
|
{
|
||||||
@ -56,6 +57,11 @@ Error::Error(Type _type): m_type(_type)
|
|||||||
solAssert(false, "");
|
solAssert(false, "");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!_location.isEmpty())
|
||||||
|
*this << errinfo_sourceLocation(_location);
|
||||||
|
if (!_description.empty())
|
||||||
|
*this << errinfo_comment(_description);
|
||||||
}
|
}
|
||||||
|
|
||||||
string Exception::lineInfo() const
|
string Exception::lineInfo() const
|
||||||
|
@ -53,7 +53,11 @@ public:
|
|||||||
Warning
|
Warning
|
||||||
};
|
};
|
||||||
|
|
||||||
explicit Error(Type _type);
|
explicit Error(
|
||||||
|
Type _type,
|
||||||
|
SourceLocation const& _location = SourceLocation(),
|
||||||
|
std::string const& _description = std::string()
|
||||||
|
);
|
||||||
|
|
||||||
Type type() const { return m_type; }
|
Type type() const { return m_type; }
|
||||||
std::string const& typeName() const { return m_typeName; }
|
std::string const& typeName() const { return m_typeName; }
|
||||||
|
Loading…
Reference in New Issue
Block a user