Skip to content

Commit a9bfe6c

Browse files
committed
DPL: clean up leftovers from input stream after parsing a workflow
1 parent cb59999 commit a9bfe6c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Framework/Core/src/WorkflowSerializationHelpers.cxx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,8 +968,17 @@ bool WorkflowSerializationHelpers::import(std::istream& s,
968968
rapidjson::IStreamWrapper isw(s);
969969
WorkflowImporter importer{workflow, metadata, command};
970970
bool ok = reader.Parse(isw, importer);
971-
if (ok == false) {
971+
if (ok == false && s.eof()) {
972972
throw std::runtime_error("Error while parsing serialised workflow");
973+
} else {
974+
// clean up leftovers at the end of the input stream, e.g. [DEBUG] message from destructors
975+
while (true) {
976+
s.getline(buf, 1024, '\n');
977+
if (s.eof()) {
978+
break;
979+
}
980+
LOG(debug) << "following leftover line found in input stream after parsing workflow: " << buf;
981+
}
973982
}
974983
return true;
975984
}

0 commit comments

Comments
 (0)