Skip to content

Commit 1908f1c

Browse files
committed
Fixed error message printing with too much work and extended tests to catch it (design-doc #19)
1 parent 43fb63b commit 1908f1c

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

stan/math/prim/functor/ode_rk45.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ ode_rk45_tol_impl(const char* function_name, const F& f,
132132
std::end(ts_vec), step_size, filtered_observer,
133133
max_step_checker(max_num_steps));
134134
} catch (const no_progress_error& e) {
135-
throw_domain_error("integrate_ode_rk45", "", ts_vec[time_index + 1],
135+
throw_domain_error(function_name, "", ts_vec[time_index + 1],
136136
"Failed to integrate to next output time (",
137137
") in less than max_num_steps steps");
138138
}

test/unit/math/prim/functor/ode_rk45_tol_prim_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,5 +444,5 @@ TEST(ode_rk45_tol_prim, too_much_work) {
444444
EXPECT_THROW_MSG(stan::math::ode_rk45_tol(CosArg1(), y0, t0, ts, 1e-6, 1e-6,
445445
100, nullptr, a),
446446
std::domain_error,
447-
"Failed to integrate to next output time");
447+
"ode_rk45_tol: Failed to integrate to next output time");
448448
}

test/unit/math/rev/functor/ode_adams_tol_prim_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,5 +444,5 @@ TEST(ode_adams_tol_prim, too_much_work) {
444444
EXPECT_THROW_MSG(stan::math::ode_adams_tol(CosArg1(), y0, t0, ts, 1e-6, 1e-6,
445445
100, nullptr, a),
446446
std::domain_error,
447-
"Failed to integrate to next output time");
447+
"ode_adams_tol: Failed to integrate to next output time");
448448
}

test/unit/math/rev/functor/ode_adams_tol_rev_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,5 +586,5 @@ TEST(StanMathOde_ode_adams_tol, too_much_work) {
586586
EXPECT_THROW_MSG(stan::math::ode_adams_tol(CosArg1(), y0, t0, ts, 1e-6, 1e-6,
587587
100, nullptr, a),
588588
std::domain_error,
589-
"Failed to integrate to next output time");
589+
"ode_adams_tol: Failed to integrate to next output time");
590590
}

test/unit/math/rev/functor/ode_bdf_tol_prim_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,5 +442,5 @@ TEST(ode_bdf_tol_prim, too_much_work) {
442442
EXPECT_THROW_MSG(stan::math::ode_bdf_tol(CosArg1(), y0, t0, ts, 1e-6, 1e-6,
443443
100, nullptr, a),
444444
std::domain_error,
445-
"Failed to integrate to next output time");
445+
"ode_bdf_tol: Failed to integrate to next output time");
446446
}

test/unit/math/rev/functor/ode_bdf_tol_rev_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,5 +586,5 @@ TEST(StanMathOde_ode_bdf_tol, too_much_work) {
586586
EXPECT_THROW_MSG(stan::math::ode_bdf_tol(CosArg1(), y0, t0, ts, 1e-6, 1e-6,
587587
100, nullptr, a),
588588
std::domain_error,
589-
"Failed to integrate to next output time");
589+
"ode_bdf_tol: Failed to integrate to next output time");
590590
}

test/unit/math/rev/functor/ode_rk45_tol_rev_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,5 +586,5 @@ TEST(StanMathOde_ode_rk45_tol, too_much_work) {
586586
EXPECT_THROW_MSG(stan::math::ode_rk45_tol(CosArg1(), y0, t0, ts, 1e-6, 1e-6,
587587
100, nullptr, a),
588588
std::domain_error,
589-
"Failed to integrate to next output time");
589+
"ode_rk45_tol: Failed to integrate to next output time");
590590
}

0 commit comments

Comments
 (0)