+/*
+ * Asserts that the current thread has no error set.
+ */
+#define BT_ASSERT_PRE_NO_ERROR() \
+ do { \
+ const struct bt_error *err = bt_current_thread_take_error(); \
+ if (err) { \
+ bt_current_thread_move_error(err); \
+ } \
+ BT_ASSERT_PRE(!err, \
+ "API function called while current thread has an " \
+ "error: function=%s", __func__); \
+ } while (0)
+