From b269202b73dc6a22c0f6adc849d8fc063119e346 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 26 Oct 2016 13:47:32 +0100 Subject: LLL: support passing error reasons --- liblll/CodeFragment.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'liblll/CodeFragment.h') diff --git a/liblll/CodeFragment.h b/liblll/CodeFragment.h index e0d48ab7..637d169f 100644 --- a/liblll/CodeFragment.h +++ b/liblll/CodeFragment.h @@ -51,6 +51,11 @@ private: void finalise(CompilerState const& _cs); template void error() const { BOOST_THROW_EXCEPTION(T() ); } + template void error(std::string const& reason) const { + auto err = T(); + err << errinfo_comment(reason); + BOOST_THROW_EXCEPTION(err); + } void constructOperation(sp::utree const& _t, CompilerState& _s); bool m_finalised = false; -- cgit