Skip to content

Commit

Permalink
Params: better error logging on constructor (commaai#29954)
Browse files Browse the repository at this point in the history
* ensure params path

* static anlysis

* revert that
  • Loading branch information
jnewb1 authored Sep 18, 2023
1 parent 747a614 commit 8aad975
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common/params.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion common/params_pyx.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8aad975

Please sign in to comment.