diff options
author | deva <deva> | 2010-05-07 12:36:13 +0000 |
---|---|---|
committer | deva <deva> | 2010-05-07 12:36:13 +0000 |
commit | 016e4ba553044edee32c2a20ee34463ad82106e8 (patch) | |
tree | 8fdde7232ee847ba39eb94449b18fd3de7bb4fb8 /server/src/transactionparser.cc | |
parent | 965e43178736e6635cf27410e6d73f4ec0fdced2 (diff) |
Use connection object instead of struct and make xml parsing on-the-fly instead of collecting all data first.
Diffstat (limited to 'server/src/transactionparser.cc')
-rw-r--r-- | server/src/transactionparser.cc | 8 |
1 files changed, 5 insertions, 3 deletions
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 |