-/* Copyright (c) 2009, 2011, 2013, 2015 Nicira, Inc.
+/* Copyright (c) 2009, 2011, 2013, 2015, 2016 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
}
+/* If 'parser' isn't already in an error state, sets its error to 'error'.
+ * Always takes ownership of 'error'. */
+void
+ovsdb_parser_put_error(struct ovsdb_parser *parser, struct ovsdb_error *error)
+{
+ if (!parser->error) {
+ parser->error = error;
+ } else {
+ ovsdb_error_destroy(error);
+ }
+}
+
struct ovsdb_error *
ovsdb_parser_get_error(const struct ovsdb_parser *parser)
{
-/* Copyright (c) 2009, 2010, 2011, 2015 Nicira, Inc.
+/* Copyright (c) 2009, 2010, 2011, 2015, 2016 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void ovsdb_parser_raise_error(struct ovsdb_parser *parser,
const char *format, ...)
OVS_PRINTF_FORMAT(2, 3);
+void ovsdb_parser_put_error(struct ovsdb_parser *, struct ovsdb_error *);
bool ovsdb_parser_has_error(const struct ovsdb_parser *);
struct ovsdb_error *ovsdb_parser_get_error(const struct ovsdb_parser *);
struct ovsdb_error *ovsdb_parser_finish(struct ovsdb_parser *)