CanteraError inerits from std:exception, so now it has a what() method that is used to print a message describing the exception. Adding an exception to the Cantera error stack now requires explicitly calling the .save() method.
17 lines
275 B
C++
17 lines
275 B
C++
#include <cantera/base/ctexceptions.h>
|
|
|
|
void demoprog()
|
|
{
|
|
// Calls Cantera
|
|
}
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
try {
|
|
demoprog();
|
|
} catch (Cantera::CanteraError& err) {
|
|
std::cout << err.what() << std::endl;
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|