X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fparser.cpp;fp=source%2Fparser.cpp;h=443c3c8c3d72a4d0951e076f260b6262d511c25f;hb=d14b7ddd81404b909a4c4763a36a23b94998a089;hp=99ece49a0375d57345cf1c905d4d395a37eeb167;hpb=67146b1b3bcb7d02307dcd4cc8b88cf778b41205;p=libs%2Fdatafile.git diff --git a/source/parser.cpp b/source/parser.cpp index 99ece49..443c3c8 100644 --- a/source/parser.cpp +++ b/source/parser.cpp @@ -1,5 +1,6 @@ #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); } }