Commit f1626e2
committed
Evaluate error message before resetting error state in macros (#1406)
This PR adjusts the ROS error-state reset behavior in the C++/N-API helper macros so the error message can be captured before the global RCL error state is cleared, improving the fidelity of JavaScript exceptions thrown from native bindings.
**Changes:**
- Move `rcl_reset_error()` to occur *after* `Napi::Error::New(...).ThrowAsJavaScriptException()` in `CHECK_OP_AND_THROW_ERROR_IF_NOT_TRUE`.
- Apply the same ordering fix to the `_NO_RETURN` variant.
Fix: #14051 parent 9fa5ed0 commit f1626e2
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
0 commit comments