]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/except.cpp
Report locations of errors through multiple levels of referenced files
[libs/datafile.git] / source / except.cpp
index d3929f6c7a8592fb6cf26fef9956c9e916f7965d..c698d83c697878945121ea666b06526998f5bd4c 100644 (file)
@@ -19,6 +19,12 @@ data_error::data_error(const string &s, unsigned l, const exception &e):
        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)