Skip to content

Commit

Permalink
better error message for wrong measurment model (order)
Browse files Browse the repository at this point in the history
refs #20
  • Loading branch information
Beyß, Martin committed Feb 23, 2022
1 parent 54c7809 commit fa62e8d
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion fluxml/MMModel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,30 @@
child = XMLElement::nextNode(child);
}


// es dürfen keine Elemente mehr folgen!
if (child != 0)
fTHROW(XMLException,child,"unexpected extra content in element \"model\"");
{
// either wrong order of elements, or unknown element
if (XMLElement::match(child,mm_labelingmeasurement,mm_xmlns_uri) ||
XMLElement::match(child,mm_fluxmeasurement,mm_xmlns_uri) ||
XMLElement::match(child,mm_fluxratios,mm_xmlns_uri) ||
XMLElement::match(child,mm_poolsizeratios,mm_xmlns_uri) ||
XMLElement::match(child,mm_poolmeasurement,mm_xmlns_uri) ||
XMLElement::match(child,mm_poolsizemeasurement,mm_xmlns_uri))
{
fTHROW(XMLException, child, "wrong oder of elements inside "
"\"model\". Correct order is \"labelingmeasurement\""
", \"fluxmeasurement\", \"fluxratios\", "
"\"poolsizeratios\", \"poolsizemeasurement\"");
}
else
{
fTHROW(XMLException, child, "unexpected extra content "
"\"%s\" in element \"model\"",
XMLElement::nodeToString(child));
}
}
}

void MMModel::parseLabelingMeasurement(DOMNode * labelingmeasurement)
Expand Down

0 comments on commit fa62e8d

Please sign in to comment.