@@ -69,6 +69,11 @@ const char *error_get_pretty(Error *err)
return err->msg;
}
+ErrorClass error_get_class(const Error *err)
+{
+ return err->err_class;
+}
+
void error_free(Error *err)
{
if (err) {
@@ -46,6 +46,11 @@ Error *error_copy(const Error *err);
const char *error_get_pretty(Error *err);
/**
+ * Get the error class of an error object.
+ */
+ErrorClass error_get_class(const Error *err);
+
+/**
* Propagate an error to an indirect pointer to an error. This function will
* always transfer ownership of the error reference and handles the case where
* dst_err is NULL correctly. Errors after the first are discarded.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> --- error.c | 5 +++++ error.h | 5 +++++ 2 files changed, 10 insertions(+)