Error reporting for animations / conditions
Don’t report errors for each condition parse failure, but do aggregate them at the animation level in ReaderWriterXML Sentry-Id: FLIGHTGEAR-DD
This commit is contained in:
committed by
Automatic Release Builder
parent
d6400e3737
commit
0a6091eeeb
@@ -535,7 +535,8 @@ readComparison( SGPropertyNode *prop_root,
|
|||||||
{
|
{
|
||||||
SGComparisonCondition * condition = new SGComparisonCondition(type, reverse);
|
SGComparisonCondition * condition = new SGComparisonCondition(type, reverse);
|
||||||
if (node->nChildren() < 2 || node->nChildren() > 3 ) {
|
if (node->nChildren() < 2 || node->nChildren() > 3 ) {
|
||||||
throw sg_exception("condition: comparison without two or three children");
|
throw sg_exception("condition: comparison without two or three children",
|
||||||
|
{}, {}, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
const SGPropertyNode* left = node->getChild(0),
|
const SGPropertyNode* left = node->getChild(0),
|
||||||
@@ -551,7 +552,8 @@ readComparison( SGPropertyNode *prop_root,
|
|||||||
SGExpressiond* exp = SGReadDoubleExpression(prop_root, left->getChild(0));
|
SGExpressiond* exp = SGReadDoubleExpression(prop_root, left->getChild(0));
|
||||||
condition->setLeftDExpression(exp);
|
condition->setLeftDExpression(exp);
|
||||||
} else {
|
} else {
|
||||||
throw sg_exception("Unknown condition comparison left child:" + leftName);
|
throw sg_exception("Unknown condition comparison left child:" + leftName,
|
||||||
|
{}, {}, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -565,7 +567,8 @@ readComparison( SGPropertyNode *prop_root,
|
|||||||
SGExpressiond* exp = SGReadDoubleExpression(prop_root, right->getChild(0));
|
SGExpressiond* exp = SGReadDoubleExpression(prop_root, right->getChild(0));
|
||||||
condition->setRightDExpression(exp);
|
condition->setRightDExpression(exp);
|
||||||
} else {
|
} else {
|
||||||
throw sg_exception("Unknown condition comparison right child:" + rightName);
|
throw sg_exception("Unknown condition comparison right child:" + rightName,
|
||||||
|
{}, {}, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -580,7 +583,8 @@ readComparison( SGPropertyNode *prop_root,
|
|||||||
SGExpressiond* exp = SGReadDoubleExpression(prop_root, n->getChild(0));
|
SGExpressiond* exp = SGReadDoubleExpression(prop_root, n->getChild(0));
|
||||||
condition->setPrecisionDExpression(exp);
|
condition->setPrecisionDExpression(exp);
|
||||||
} else {
|
} else {
|
||||||
throw sg_exception("Unknown condition comparison precision child:" + name );
|
throw sg_exception("Unknown condition comparison precision child:" + name,
|
||||||
|
{}, {}, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -574,13 +574,22 @@ sgLoad3DModel_internal(const SGPath& path,
|
|||||||
} // of object-names in the animation
|
} // of object-names in the animation
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* Setup the model data for the node currently being animated.
|
try {
|
||||||
*/
|
/*
|
||||||
modelData.LoadAnimationValuesForElement(animation_nodes[i], i);
|
* Setup the model data for the node currently being animated.
|
||||||
|
*/
|
||||||
|
modelData.LoadAnimationValuesForElement(animation_nodes[i], i);
|
||||||
|
|
||||||
/// OSGFIXME: duh, why not only model?????
|
/// OSGFIXME: duh, why not only model?????
|
||||||
SGAnimation::animate(modelData);
|
SGAnimation::animate(modelData);
|
||||||
|
} catch (sg_exception& e) {
|
||||||
|
simgear::reportFailure(simgear::LoadFailure::NotFound, simgear::ErrorCode::XMLModelLoad,
|
||||||
|
"Couldn't load animation " + animation_nodes[i]->getNameString()
|
||||||
|
+ ":" + e.getFormattedMessage(),
|
||||||
|
modelpath);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
animationcount += animation_nodes.size();
|
animationcount += animation_nodes.size();
|
||||||
|
|||||||
Reference in New Issue
Block a user