+
+/* If 'error' is nonnull, logs it as an error and frees it. To be used in
+ * situations where an error should never occur, but an 'ovsdb_error *' gets
+ * passed back anyhow. */
+void
+ovsdb_error_assert(struct ovsdb_error *error)
+{
+ if (error) {
+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1);
+ char *s = ovsdb_error_to_string(error);
+ VLOG_ERR_RL(&rl, "unexpected ovsdb error: %s", s);
+ free(s);
+ ovsdb_error_destroy(error);
+ }
+}