File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
rcljava_common/include/rcljava_common Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 3737 */
3838#define RCLJAVA_COMMON_EXCEPTION_CHECK (env ) RCLJAVA_COMMON_EXCEPTION_CHECK_X(env, return )
3939
40+ // / Call \ref rcljava_throw_rclexception if \a ret is not RCL_RET_OK,
41+ // / and execute \a error_statement in that case.
42+ /* *
43+ * \param env a JNIEnv pointer, used to throw a java exception from the rcl error.
44+ * \param ret rcl_ret_t error that will be checked.
45+ * \param message error message that will be passed to the thrown exception.
46+ * \param error_statement statement executed if ret was not RCL_RET_OK.
47+ */
48+ #define RCLJAVA_COMMON_THROW_FROM_RCL_X (env, ret, message, error_statement ) \
49+ do { \
50+ if (RCL_RET_OK != ret) { \
51+ rcljava_common::exception::rcljava_throw_rclexception (env, ret, message); \
52+ error_statement; \
53+ } \
54+ } while (0 )
55+
56+ // / Call \ref rcljava_throw_rclexception if \a ret is not RCL_RET_OK and return.
57+ /* *
58+ * \param env a JNIEnv pointer, used to check for exceptions.
59+ * \param ret rcl_ret_t error that will be checked.
60+ * \param message error message that will be passed to the thrown exception.
61+ */
62+ #define RCLJAVA_COMMON_THROW_FROM_RCL (env, ret, message ) \
63+ RCLJAVA_COMMON_THROW_FROM_RCL_X (env, ret, message, return )
64+
4065namespace rcljava_common
4166{
4267namespace exceptions
You can’t perform that action at this time.
0 commit comments