From cae253455831ff83d89c730fdb1342ed9b0ff7a3 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Wed, 20 Sep 2023 07:22:33 +0800 Subject: [PATCH] params: log `prefix` on fail (#29973) old-commit-hash: 81d4595c190c8fcbf3fa27d45d088449ae6c4f4e --- common/params.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/params.cc b/common/params.cc index e510b60160..6722dbb3eb 100644 --- a/common/params.cc +++ b/common/params.cc @@ -64,7 +64,9 @@ bool create_params_path(const std::string ¶m_path, const std::string &key_pa std::string ensure_params_path(const std::string &prefix, const std::string &path = {}) { std::string params_path = path.empty() ? Path::params() : path; if (!create_params_path(params_path, params_path + prefix)) { - throw std::runtime_error(util::string_format("Failed to ensure params path, errno=%d, path=%s", errno, params_path.c_str())); + throw std::runtime_error(util::string_format( + "Failed to ensure params path, errno=%d, path=%s, param_prefix=%s", + errno, params_path.c_str(), prefix.c_str())); } return params_path; }