X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fparser.cpp;h=443c3c8c3d72a4d0951e076f260b6262d511c25f;hb=9bd3968eaaabb278d22f182365d022704d2a2cf1;hp=957018f7a35c1e302e659da5f4ac5650f14aeca6;hpb=7df5e45c7f414f6a07681dc4ec2abb63b091a309;p=libs%2Fdatafile.git diff --git a/source/parser.cpp b/source/parser.cpp index 957018f..443c3c8 100644 --- a/source/parser.cpp +++ b/source/parser.cpp @@ -1,5 +1,6 @@ -#include +#include #include "binaryparser.h" +#include "dataerror.h" #include "parser.h" #include "statement.h" #include "textparser.h" @@ -25,7 +26,7 @@ Parser::~Parser() Statement Parser::parse() { if(!good) - throw Exception("Parser is not good"); + throw logic_error("Parser::parse() !good"); try { @@ -54,10 +55,13 @@ Statement Parser::parse() return st; } } - catch(const Exception &e) + catch(const exception &e) { good = false; - throw; + if(dynamic_cast(&e)) + throw; + else + throw data_error(src, in.get_line_number(), e); } }