Add exception handlers to all tutorials and examples

This commit is contained in:
Andreas Lauser
2013-09-05 12:28:04 +02:00
parent a26483b51d
commit 51cb4f2cb8
12 changed files with 57 additions and 0 deletions
+6
View File
@@ -109,6 +109,7 @@ fluxFunc(const std::vector<ADB>& m)
int main()
try
{
typedef AutoDiff::ForwardBlock<double> ADB;
typedef ADB::V V;
@@ -296,3 +297,8 @@ int main()
<< "function s1 = solution\n"
<< "s1 = [\n" << sw1 << "\n];\n";
}
catch (const std::exception &e) {
std::cerr << "Program threw an exception: " << e.what() << "\n";
throw;
}