]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/loader.cpp
Report locations of errors through multiple levels of referenced files
[libs/datafile.git] / source / loader.cpp
index 960621cf3b47c48fcef8d5e016c5bb210b4f31eb..3484799a3e4891b12b622139b646e27a582690a1 100644 (file)
@@ -131,9 +131,12 @@ void Loader::load_statement(const Statement &st)
                                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)
        {