Skip to content

Commit 7fa767d

Browse files
committed
Fix wording of error on dimension mismatch
1 parent b9d0a33 commit 7fa767d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stan/math/prim/err/check_matching_dims.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ inline void check_matching_dims(const char* function, const char* name1,
8585
[&]() STAN_COLD_PATH {
8686
std::ostringstream y1_err;
8787
std::ostringstream msg_str;
88-
y1_err << "(" << y1.rows() << ", " << y1.cols() << ")";
89-
msg_str << y2.rows() << ", " << y2.cols() << ") must match in size";
90-
invalid_argument(function, name1, y1_err.str(), "(",
88+
y1_err << "(" << y1.rows() << ", " << y1.cols() << ") and ";
89+
msg_str << " (" << y2.rows() << ", " << y2.cols() << ") must match in size";
90+
invalid_argument(function, name1, name2, std::string(y1_err.str()).c_str(),
9191
std::string(msg_str.str()).c_str());
9292
}();
9393
}

0 commit comments

Comments
 (0)