line(l)
{ }
+data_error::data_error(const string &s, unsigned l, const data_error &e):
+ runtime_error(format("%s\n%s", e.what(), make_what(s, l, "Referenced here"))),
+ source(s),
+ line(l)
+{ }
+
string data_error::make_what(const string &s, unsigned l, const string &w)
{
if(l)
public:
data_error(const std::string &, unsigned, const std::string &);
data_error(const std::string &, unsigned, const std::exception &);
+ data_error(const std::string &, unsigned, const data_error &);
virtual ~data_error() throw() { }
const std::string &get_source() const { return source; }
throw logic_error("substatements ignored");
}
}
- catch(const data_error &)
+ catch(const data_error &e)
{
- throw;
+ if(e.get_source()!=st.source)
+ throw data_error(st.source, st.line, e);
+ else
+ throw;
}
catch(const exception &e)
{