diff --git a/dune/solvers/solvers/quadraticipopt.hh b/dune/solvers/solvers/quadraticipopt.hh
index 65b695c1942d1b7a36c391b20af6bfbbf0a05b99..1e516f02e4e81db7836f185042e2384866a69bb8 100644
--- a/dune/solvers/solvers/quadraticipopt.hh
+++ b/dune/solvers/solvers/quadraticipopt.hh
@@ -813,10 +813,18 @@ void QuadraticIPOptSolver<MatrixType,VectorType,JacobianType>::solve()
   if (status == Ipopt::Solved_To_Acceptable_Level)
       std::cout<<"WARNING: Desired tolerance could not be reached, but still acceptable tolerance is reached.\n";
   else if (status == Ipopt::Search_Direction_Becomes_Too_Small) {
-      std::array<Ipopt::Number,4> inf;
-      app->Statistics()->Infeasibilities(inf[0],inf[1],inf[2],inf[3]);
-      if (inf[3]>std::max(1e-10,this->tolerance_))
-              DUNE_THROW(Dune::Exception,Dune::formatString("Problem could not be solved to acceptable accuracy %d",inf[3]));
+      Ipopt::Number dual_inf;        // dual infeasibility (Gradient of Lagrangian not zero)
+      Ipopt::Number constr_viol;     // violation of constraints
+      Ipopt::Number complementarity; // violation of complementarity
+      Ipopt::Number kkt_error;       // KKT error
+
+      app->Statistics()->Infeasibilities(dual_inf,
+                                         constr_viol,
+                                         complementarity,
+                                         kkt_error);
+
+      if (kkt_error>std::max(1e-10,this->tolerance_))
+              DUNE_THROW(Dune::Exception,Dune::formatString("Problem could not be solved to acceptable accuracy %d", kkt_error));
 
   } else if (status != Ipopt::Solve_Succeeded)
       DUNE_THROW(Dune::Exception, "IPOpt: Error during optimization!");