Params: better error logging on constructor (#29954)

* ensure params path

* static anlysis

* revert that
old-commit-hash: 8aad9758cf
pull/30094/head
Justin Newberry 2 years ago committed by GitHub
parent 1925b7e9bf
commit baa86681f7
  1. 2
      common/params.cc
  2. 2
      common/params_pyx.pyx

@ -64,7 +64,7 @@ bool create_params_path(const std::string &param_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", errno));
throw std::runtime_error(util::string_format("Failed to ensure params path, errno=%d, path=%s", errno, params_path.c_str()));
}
return params_path;
}

@ -14,7 +14,7 @@ cdef extern from "common/params.h":
ALL
cdef cppclass c_Params "Params":
c_Params(string) nogil
c_Params(string) nogil except +
string get(string, bool) nogil
bool getBool(string, bool) nogil
int remove(string) nogil

Loading…
Cancel
Save