Improved error messages that just reported 'confused'

This commit is contained in:
Ray Speth 2014-07-10 22:36:43 +00:00
parent 5ebdb7e924
commit 45f6e84ebf
6 changed files with 24 additions and 16 deletions

View file

@ -213,7 +213,7 @@ SpeciesThermoDuo<T1, T2>::reportParams(size_t index, int& type,
m_thermo2.reportParams(index, type, c, minTemp_, maxTemp_,
refPressure_);
} else {
throw CanteraError(" ", "confused");
throw CanteraError("SpeciesThermoDuo", "mismatched SpeciesThermoInterpType");
}
}

View file

@ -378,7 +378,8 @@ void LatticeSolidPhase::installSlavePhases(Cantera::XML_Node* phaseNode)
std::string oldEname = lp->elementName(m);
size_t newIndex = elementIndex(oldEname);
if (newIndex == npos) {
throw CanteraError("LatticeSolidPhase::installSlavePhases", "confused");
throw CanteraError("LatticeSolidPhase::installSlavePhases",
"element not found");
}
ecomp[newIndex] = constArr[m];
}

View file

@ -577,7 +577,8 @@ doublereal MixtureFugacityTP::densityCalc(doublereal TKelvin, doublereal presPa,
*/
if (dpdVBase >= 0.0) {
if (TKelvin > tcrit) {
throw CanteraError("", "confused");
throw CanteraError("MixtureFugacityTP::densityCalc",
"T > tcrit unexpectedly");
}
/*
* TODO Spawn a calculation for the value of the spinodal point that is

View file

@ -187,21 +187,23 @@ void NasaThermo::reportParams(size_t index, int& type,
lowPoly->reportParameters(n, itype, minTemp, ttemp, refPressure,
c + 1);
if (n != index) {
throw CanteraError(" ", "confused");
throw CanteraError("NasaThermo::reportParams", "Index mismatch");
}
if (itype != NASA1) {
throw CanteraError(" ", "confused");
throw CanteraError("NasaThermo::reportParams",
"Thermo type mismatch for low-T polynomial");
}
highPoly->reportParameters(n, itype, ttemp, maxTemp, refPressure,
c + 8);
if (n != index) {
throw CanteraError(" ", "confused");
throw CanteraError("NasaThermo::reportParams", "Index mismatch");
}
if (itype != NASA1) {
throw CanteraError(" ", "confused");
throw CanteraError("NasaThermo::reportParams",
"Thermo type mismatch for high-T polynomial");
}
} else {
throw CanteraError(" ", "confused");
throw CanteraError("NasaThermo::reportParams", "Thermo type mismatch");
}
}

View file

@ -137,10 +137,10 @@ void Phase::setXMLdata(XML_Node& xmlPhase)
}
m_xml = findXMLPhase(root_xml, iidd);
if (!m_xml) {
throw CanteraError("Phase::setXMLdata()", "confused");
throw CanteraError("Phase::setXMLdata()", "XML 'phase' node not found");
}
if (&(m_xml->root()) != root_xml) {
throw CanteraError("Phase::setXMLdata()", "confused");
throw CanteraError("Phase::setXMLdata()", "Root XML node not found");
}
}
@ -835,7 +835,7 @@ size_t Phase::addUniqueElementAfterFreeze(const std::string& symbol,
m_elementsFrozen = true;
ii = elementIndex(symbol);
if (ii != m_mm-1) {
throw CanteraError("Phase::addElementAfterFreeze()", "confused");
throw CanteraError("Phase::addElementAfterFreeze()", "index error");
}
if (m_kk > 0) {
vector_fp old(m_speciesComp);

View file

@ -305,21 +305,25 @@ public:
lowPoly->reportParameters(n, itype, minTemp, ttemp, refPressure,
c + 1);
if (n != index) {
throw CanteraError(" ", "confused");
throw CanteraError("ShomateThermo::reportParams",
"Index mismatch in low-T polynomial");
}
if (itype != SHOMATE && itype != SHOMATE1) {
throw CanteraError(" ", "confused");
throw CanteraError("ShomateThermo::reportParams",
"Thermo type mismatch in low-T polynomial");
}
highPoly->reportParameters(n, itype, ttemp, maxTemp,
refPressure, c + 8);
if (n != index) {
throw CanteraError(" ", "confused");
throw CanteraError("ShomateThermo::reportParams",
"Index mismatch in high-T polynomial");
}
if (itype != SHOMATE && itype != SHOMATE1) {
throw CanteraError(" ", "confused");
throw CanteraError("ShomateThermo::reportParams",
"Thermo type mismatch in high-T polynomial");
}
} else {
throw CanteraError(" ", "confused");
throw CanteraError("ShomateThermo::reportParams", "Thermo type mismatch");
}
}