diff --git a/stan/math/prim/meta/forward_as.hpp b/stan/math/prim/meta/forward_as.hpp index 838e1d336fc..de2cd68a1ee 100644 --- a/stan/math/prim/meta/forward_as.hpp +++ b/stan/math/prim/meta/forward_as.hpp @@ -59,7 +59,10 @@ template , std::decay>::value && (!is_eigen::value || !is_eigen::value)>> inline T_desired forward_as(const T_actual& a) { - throw std::runtime_error("Wrong type assumed! Please file a bug report."); + throw std::runtime_error( + "Wrong type assumed! Please file a bug report. prim/meta/forward_as.hpp " + "line " + + std::to_string(__LINE__)); } /** \ingroup type_trait @@ -120,7 +123,10 @@ template < T_desired::ColsAtCompileTime, std::decay_t::ColsAtCompileTime)>* = nullptr> inline T_desired forward_as(const T_actual& a) { - throw std::runtime_error("Wrong type assumed! Please file a bug report."); + throw std::runtime_error( + "Wrong type assumed! Please file a bug report. prim/meta/forward_as.hpp " + "line " + + std::to_string(__LINE__)); } } // namespace math diff --git a/stan/math/rev/fun/adjoint_of.hpp b/stan/math/rev/fun/adjoint_of.hpp index c726835cfe8..7eb135f3167 100644 --- a/stan/math/rev/fun/adjoint_of.hpp +++ b/stan/math/rev/fun/adjoint_of.hpp @@ -16,13 +16,15 @@ struct nonexisting_adjoint { nonexisting_adjoint operator+=(T) const { throw std::runtime_error( "internal::nonexisting_adjoint::operator+= should never be called! " - "Please file a bug report."); + "Please file a bug report. rev/fun/adjoint_of.hpp line " + + std::to_string(__LINE__)); } template nonexisting_adjoint operator-=(T) const { throw std::runtime_error( "internal::nonexisting_adjoint::operator-= should never be called! " - "Please file a bug report."); + "Please file a bug report. rev/fun/adjoint_of.hpp line " + + std::to_string(__LINE__)); } }; } // namespace internal