fixed: catch exception by reference

class is polymorphic
This commit is contained in:
Arne Morten Kvarving
2018-07-16 13:43:09 +02:00
parent f1f95f9b7b
commit c4da1b27ba
2 changed files with 5 additions and 5 deletions

View File

@@ -99,7 +99,7 @@ TEST(TestISTLMatrix, AssembleMPI)
b = 1.0;
op.apply(b, b2);
} catch (Dune::ISTLError e) {
} catch (Dune::ISTLError& e) {
std::cerr << e << std::endl;
ASSERT_TRUE(false);
}

View File

@@ -113,7 +113,7 @@ EvalFunc::EvalFunc (const char* function, const char* x, Real eps)
arg[i] = v[i]->GetAddress(x);
}
}
catch (ExprEval::Exception e) {
catch (ExprEval::Exception& e) {
this->cleanup();
ExprException(e,"parsing",function);
}
@@ -162,7 +162,7 @@ Real EvalFunc::evaluate (const Real& x) const
*arg[i] = x;
result = expr[i]->Evaluate();
}
catch (ExprEval::Exception e) {
catch (ExprEval::Exception& e) {
ExprException(e,"evaluating expression");
}
@@ -211,7 +211,7 @@ EvalFunction::EvalFunction (const char* function) : gradient{}, dgradient{}
arg[i].t = v[i]->GetAddress("t");
}
}
catch (ExprEval::Exception e) {
catch (ExprEval::Exception& e) {
this->cleanup();
ExprException(e,"parsing",function);
}
@@ -306,7 +306,7 @@ Real EvalFunction::evaluate (const Vec3& X) const
*arg[i].t = Xt ? Xt->t : Real(0);
result = expr[i]->Evaluate();
}
catch (ExprEval::Exception e) {
catch (ExprEval::Exception& e) {
ExprException(e,"evaluating expression");
}