Skip to content

Commit b96e321

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

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Framework/Core/src/WorkflowSerializationHelpers.cxx

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

0 commit comments

Comments
 (0)