From 759a5692b86ac4b12154379dba73319dff6ebe6d Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Thu, 25 Jan 2024 10:51:44 -0500 Subject: [PATCH] Fix pathfinder return --- src/stan/services/pathfinder/single.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/stan/services/pathfinder/single.hpp b/src/stan/services/pathfinder/single.hpp index 4719a40e1e..9b19f0be29 100644 --- a/src/stan/services/pathfinder/single.hpp +++ b/src/stan/services/pathfinder/single.hpp @@ -821,10 +821,14 @@ inline auto pathfinder_lbfgs_single( lbfgs_ss.str(""); } if (ReturnLpSamples) { + // we want to terminate multi-path pathfinder during these unrecoverable + // exceptions throw; } else { logger.error(e.what()); - return error_codes::SOFTWARE; + return internal::ret_pathfinder( + error_codes::SOFTWARE, Eigen::Array(0), + Eigen::Matrix(0, 0), 0); } } }