Skip to content

Commit

Permalink
feat: add diopi error code and message to exception
Browse files Browse the repository at this point in the history
  • Loading branch information
lljbash committed Jan 24, 2024
1 parent f5e715f commit b56e5f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion csrc/diopi_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ void callDiopi(DiopiFunc&& diopi_func, Args&&... args) {
diopiError_t err_code =
diopi_func(&ctx, castToDiopiType(std::forward<Args>(args))...);
if (err_code != diopiSuccess) {
throw std::runtime_error("DIOPI call failed");
throw std::runtime_error("DIOPI error, code: " + std::to_string(err_code) +
", message: " + diopiGetLastErrorString());
}
}

Expand Down

0 comments on commit b56e5f5

Please sign in to comment.