diff options
Diffstat (limited to 'project2/iterate.cpp')
-rw-r--r-- | project2/iterate.cpp | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/project2/iterate.cpp b/project2/iterate.cpp index f0097c8..ccf289e 100644 --- a/project2/iterate.cpp +++ b/project2/iterate.cpp @@ -7,7 +7,8 @@ DECLARE_LOADER("iterate", Iterate); Iterate::Iterate(const xmlpp::Element * p) : SourceObject(p), NoOutputExecute(p), - RowProcessor(p) + RowProcessor(p), + localErrorHandling(p->get_attribute_value("errorHandling") == "local") { LoaderBase loader("http://project2.randomdan.homeip.net", true); loader.supportedStorers.insert(Storer::into(&subNOEs)); @@ -27,7 +28,7 @@ Iterate::loadComplete(const CommonObjects * co) void Iterate::rowReady() const { - executeChildren(); + executeChildren(false); source->rowChanged(); } @@ -44,26 +45,31 @@ Iterate::execute() const } catch (...) { RowSet::endRow(source.get()); - throw; + executeChildren(true); + if (!localErrorHandling) { + throw; + } } } void -Iterate::executeChildren() const +Iterate::executeChildren(bool errs) const { BOOST_FOREACH(const SubNOEs::value_type & sq, subNOEs.get<bySOOrder>()) { - if (dynamic_cast<const RowProcessor *>(sq.get())) { - sq->execute(); - } - else { - RowSet::beginRow(NULL); - try { + if (sq->isErrorHandler == errs) { + if (dynamic_cast<const RowProcessor *>(sq.get())) { sq->execute(); - RowSet::endRow(NULL); } - catch (...) { - RowSet::endRow(NULL); - throw; + else { + RowSet::beginRow(NULL); + try { + sq->execute(); + RowSet::endRow(NULL); + } + catch (...) { + RowSet::endRow(NULL); + throw; + } } } } |