aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Jentzsch <jentzsch.software@gmail.com>2014-10-02 20:20:33 +0800
committerChristoph Jentzsch <jentzsch.software@gmail.com>2014-10-02 20:20:33 +0800
commitf61c3232449d36cc44bcff70240f5292bf8f9f16 (patch)
tree4e01f1f1804dc1381bb8464d9f0ef7a2671330d3
parent55d0e1c34ef3c14b2c262fe7edd4fdc2f18bcfb5 (diff)
downloaddexon-solidity-f61c3232449d36cc44bcff70240f5292bf8f9f16.tar
dexon-solidity-f61c3232449d36cc44bcff70240f5292bf8f9f16.tar.gz
dexon-solidity-f61c3232449d36cc44bcff70240f5292bf8f9f16.tar.bz2
dexon-solidity-f61c3232449d36cc44bcff70240f5292bf8f9f16.tar.lz
dexon-solidity-f61c3232449d36cc44bcff70240f5292bf8f9f16.tar.xz
dexon-solidity-f61c3232449d36cc44bcff70240f5292bf8f9f16.tar.zst
dexon-solidity-f61c3232449d36cc44bcff70240f5292bf8f9f16.zip
Restructured exceptions. Boost::exception is now used primarily.
-rw-r--r--Assembly.cpp2
-rw-r--r--Assembly.h2
-rw-r--r--CodeFragment.h2
-rw-r--r--Compiler.cpp7
-rw-r--r--Parser.cpp2
5 files changed, 9 insertions, 6 deletions
diff --git a/Assembly.cpp b/Assembly.cpp
index 2250a71f..9b6dee94 100644
--- a/Assembly.cpp
+++ b/Assembly.cpp
@@ -102,7 +102,7 @@ void Assembly::append(Assembly const& _a)
void Assembly::append(Assembly const& _a, int _deposit)
{
if (_deposit > _a.m_deposit)
- throw InvalidDeposit();
+ BOOST_THROW_EXCEPTION(InvalidDeposit());
else
{
append(_a);
diff --git a/Assembly.h b/Assembly.h
index b8152fe0..b7feaf4f 100644
--- a/Assembly.h
+++ b/Assembly.h
@@ -111,7 +111,7 @@ public:
std::ostream& streamOut(std::ostream& _out, std::string const& _prefix = "") const;
private:
- void donePath() { if (m_totalDeposit != INT_MAX && m_totalDeposit != m_deposit) throw InvalidDeposit(); }
+ void donePath() { if (m_totalDeposit != INT_MAX && m_totalDeposit != m_deposit) BOOST_THROW_EXCEPTION(InvalidDeposit()); }
unsigned bytesRequired() const;
unsigned m_usedTags = 0;
diff --git a/CodeFragment.h b/CodeFragment.h
index 60ab7c6d..d6ca86bb 100644
--- a/CodeFragment.h
+++ b/CodeFragment.h
@@ -50,7 +50,7 @@ public:
private:
void finalise(CompilerState const& _cs);
- template <class T> void error() const { throw T(); }
+ template <class T> void error() const { BOOST_THROW_EXCEPTION(T() ); }
void constructOperation(sp::utree const& _t, CompilerState& _s);
bool m_finalised = false;
diff --git a/Compiler.cpp b/Compiler.cpp
index 389c10be..37fb3c34 100644
--- a/Compiler.cpp
+++ b/Compiler.cpp
@@ -43,7 +43,10 @@ bytes dev::eth::compileLLL(string const& _src, bool _opt, vector<string>* _error
catch (Exception const& _e)
{
if (_errors)
- _errors->push_back(_e.description());
+ {
+ _errors->push_back("Parse error.");
+ _errors->push_back(diagnostic_information(_e));
+ }
}
catch (std::exception)
{
@@ -67,7 +70,7 @@ std::string dev::eth::compileLLLToAsm(std::string const& _src, bool _opt, std::v
catch (Exception const& _e)
{
if (_errors)
- _errors->push_back(_e.description());
+ _errors->push_back(diagnostic_information(_e));
}
catch (std::exception)
{
diff --git a/Parser.cpp b/Parser.cpp
index 52a05174..e94e88e1 100644
--- a/Parser.cpp
+++ b/Parser.cpp
@@ -140,6 +140,6 @@ void dev::eth::parseTreeLLL(string const& _s, sp::utree& o_out)
qi::phrase_parse(ret, s.cend(), element, space, qi::skip_flag::dont_postskip, o_out);
for (auto i = ret; i != s.cend(); ++i)
if (!isspace(*i))
- throw std::exception();
+ BOOST_THROW_EXCEPTION(std::exception());
}