Patchwork [26/35] error: add error_get_class()

login
register
mail settings
Submitter Luiz Capitulino
Date Aug. 7, 2012, 3:53 p.m.
Message ID <1344354826-10375-27-git-send-email-lcapitulino@redhat.com>
Download mbox | patch
Permalink /patch/175696/
State New
Headers show

Comments

Luiz Capitulino - Aug. 7, 2012, 3:53 p.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 648706a..2d34cde 100644
--- a/error.c
+++ b/error.c
@@ -64,6 +64,11 @@  bool error_is_set(Error **errp)
     return (errp && *errp);
 }
 
+ErrorClass error_get_class(const Error *err)
+{
+    return err->err_class;
+}
+
 const char *error_get_pretty(Error *err)
 {
     return err->msg;
diff --git a/error.h b/error.h
index 9678752..114e24b 100644
--- a/error.h
+++ b/error.h
@@ -35,6 +35,11 @@  void error_set(Error **err, ErrorClass err_class, const char *fmt, ...) GCC_FMT_
  */
 bool error_is_set(Error **err);
 
+/*
+ * Get the error class of an error object.
+ */
+ErrorClass error_get_class(const Error *err);
+
 /**
  * Returns an exact copy of the error passed as an argument.
  */