Patchwork [28/34] error: add error_get_class()

login
register
mail settings
Submitter Luiz Capitulino
Date Aug. 2, 2012, 1:02 a.m.
Message ID <1343869374-23417-29-git-send-email-lcapitulino@redhat.com>
Download mbox | patch
Permalink /patch/174634/
State New
Headers show

Comments

Luiz Capitulino - Aug. 2, 2012, 1:02 a.m.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 error.c | 5 +++++
 error.h | 5 +++++
 2 files changed, 10 insertions(+)

Patch

diff --git a/error.c b/error.c
index 6c8f7b8..15a2d06 100644
--- a/error.c
+++ b/error.c
@@ -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) {
diff --git a/error.h b/error.h
index 905613a..7b85b50 100644
--- a/error.h
+++ b/error.h
@@ -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.