From 016e4ba553044edee32c2a20ee34463ad82106e8 Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 7 May 2010 12:36:13 +0000 Subject: Use connection object instead of struct and make xml parsing on-the-fly instead of collecting all data first. --- server/src/transactionparser.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'server/src/transactionparser.cc') diff --git a/server/src/transactionparser.cc b/server/src/transactionparser.cc index 7422a13..7595bb2 100644 --- a/server/src/transactionparser.cc +++ b/server/src/transactionparser.cc @@ -72,17 +72,17 @@ void TransactionParser::startTag(std::string name, if(name == "field") { if(!transaction->commits.size()) { PRACRO_ERR(transactionparser, "Field without a commit tag!"); - return; + throw std::exception(); } if(attributes.find("name") == attributes.end()) { PRACRO_ERR(transactionparser, "Field is missing 'name' attribute"); - return; + throw std::exception(); } if(attributes.find("value") == attributes.end()) { PRACRO_ERR(transactionparser, "Field is missing 'value' attribute"); - return; + throw std::exception(); } transaction->commits.back().fields[attributes["name"]] = @@ -101,6 +101,8 @@ void TransactionParser::parseError(const char *buf, size_t len, PRACRO_ERR(transactionparser, "\tBuffer %u bytes: [%s]\n", len, xml.c_str()); + + throw std::exception(); } #ifdef TEST_TRANSACTIONPARSER -- cgit v1.2.3