Slightly nicer error message

This commit is contained in:
Ian Bell
2016-09-30 00:51:53 -06:00
parent fd1fe626b2
commit 84a00830b1

View File

@@ -126,7 +126,7 @@ template <typename T> void bisect_vector(const std::vector<T> &vec, T val, std::
L = MR; rL = vec[MR] - val;
}
else{
throw CoolProp::ValueError(format("Unable to bisect segmented vector; neither chunk contains the solution %g %g %g %g", rL, rML, rMR, rR));
throw CoolProp::ValueError(format("Unable to bisect segmented vector; neither chunk contains the solution val:%g left:(%g,%g) right:(%g,%g)", val, vec[L], vec[ML], vec[MR], vec[R]));
}
M = (L+R)/2;
}
@@ -196,7 +196,7 @@ template <typename T> void bisect_segmented_vector_slice(const std::vector<std::
L = MR; rL = mat[MR][j] - val;
}
else{
throw CoolProp::ValueError(format("Unable to bisect segmented vector slice; neither chunk contains the solution %g %g %g %g", rL,rML,rMR,rR));
throw CoolProp::ValueError(format("Unable to bisect segmented vector slice; neither chunk contains the solution %g lef:(%g,%g) right:(%g,%g)", val, mat[L][j], mat[ML][j], mat[MR][j], mat[R][j]));
}
M = (L+R)/2;
}