diff --git a/evrpc.c b/evrpc.c
index fd1f67c..99c5573 100644
--- a/evrpc.c
+++ b/evrpc.c
@@ -68,6 +68,22 @@
 #include "log-internal.h"
 #include "mm-internal.h"
 
+/**
+   Functions related to error handling
+*/
+
+enum evrpc_status_code
+evrpc_status_error(struct evrpc_status *status)
+{
+	return status->error;
+}
+
+struct evhttp_request *
+evrpc_status_http_request(struct evrpc_status *status)
+{
+	return status->http_req;
+}
+
 struct evrpc_base *
 evrpc_init(struct evhttp *http_server)
 {
diff --git a/include/event2/rpc.h b/include/event2/rpc.h
index dd43df2..72091f9 100644
--- a/include/event2/rpc.h
+++ b/include/event2/rpc.h
@@ -141,6 +141,27 @@ extern "C" {
 */
 #define EVTAG_ARRAY_LEN(msg, member) ((msg)->member##_length)
 
+struct evrpc_status;
+
+/**
+   Functions related to error handling
+*/
+
+struct evrpc_status;
+
+enum evrpc_status_code {
+	EVRPC_STATUS_ERR_NONE = 0,
+	EVRPC_STATUS_ERR_TIMEOUT = 1,
+	EVRPC_STATUS_ERR_BADPAYLOAD = 2,
+	EVRPC_STATUS_ERR_UNSTARTED = 3,
+	EVRPC_STATUS_ERR_HOOKABORTED = 4,
+};
+
+enum evrpc_status_code
+evrpc_status_error(struct evrpc_status *);
+
+struct evhttp_request *
+evrpc_status_http_request(struct evrpc_status *);
 
 struct evbuffer;
 struct event_base;
@@ -155,7 +176,6 @@ struct evrpc;
 #define EVRPC_STRUCT(rpcname) struct evrpc_req__##rpcname
 
 struct evhttp_request;
-struct evrpc_status;
 struct evrpc_hook_meta;
 
 /** Creates the definitions and prototypes for an RPC
@@ -354,7 +374,6 @@ int evrpc_unregister_rpc(struct evrpc_base *base, const char *name);
  */
 
 struct evhttp_connection;
-struct evrpc_status;
 
 /** launches an RPC and sends it to the server
  *
diff --git a/include/event2/rpc_struct.h b/include/event2/rpc_struct.h
index 8f691f4..3b00790 100644
--- a/include/event2/rpc_struct.h
+++ b/include/event2/rpc_struct.h
@@ -42,12 +42,8 @@ extern "C" {
  * provides information about the completed RPC request.
  */
 struct evrpc_status {
-#define EVRPC_STATUS_ERR_NONE		0
-#define EVRPC_STATUS_ERR_TIMEOUT	1
-#define EVRPC_STATUS_ERR_BADPAYLOAD	2
-#define EVRPC_STATUS_ERR_UNSTARTED	3
-#define EVRPC_STATUS_ERR_HOOKABORTED	4
-	int error;
+	/* error code (defined in event2/rpc.h) */
+	enum evrpc_status_code error;
 
 	/* for looking at headers or other information */
 	struct evhttp_request *http_req;
diff --git a/test/regress_rpc.c b/test/regress_rpc.c
index 0a5c7a3..691d724 100644
--- a/test/regress_rpc.c
+++ b/test/regress_rpc.c
@@ -724,6 +724,43 @@ end:
 		evhttp_free(http);
 }
 
+
+static int
+evrpc_test_status(struct evrpc_status *s, enum evrpc_status_code expected)
+{
+    return evrpc_status_error(s) == expected ? 1 : 0;
+}
+
+static void
+rpc_evrpc_status_errors(void)
+{
+    struct evrpc_status s;
+    int res = 0;
+
+    s.http_req = NULL;
+    s.error = EVRPC_STATUS_ERR_NONE;
+    res += evrpc_test_status(&s, EVRPC_STATUS_ERR_NONE);
+
+    s.error = EVRPC_STATUS_ERR_TIMEOUT;
+    res += evrpc_test_status(&s, EVRPC_STATUS_ERR_TIMEOUT);
+
+    s.error = EVRPC_STATUS_ERR_BADPAYLOAD;
+    res += evrpc_test_status(&s, EVRPC_STATUS_ERR_BADPAYLOAD);
+
+    s.error = EVRPC_STATUS_ERR_HOOKABORTED;
+    res += evrpc_test_status(&s, EVRPC_STATUS_ERR_HOOKABORTED);
+
+    s.error = EVRPC_STATUS_ERR_UNSTARTED;
+    res += evrpc_test_status(&s, EVRPC_STATUS_ERR_UNSTARTED);
+
+    if (res != 5)
+        tt_abort_msg("unable to access the right error codes");
+    else
+        test_ok = 1;
+end:
+    return ;
+}
+
 static void
 rpc_test(void)
 {
@@ -893,6 +930,7 @@ struct testcase_t rpc_testcases[] = {
 	RPC_LEGACY(basic_client_with_pause),
 	RPC_LEGACY(client_timeout),
 	RPC_LEGACY(test),
+	RPC_LEGACY(evrpc_status_errors),
 
 	END_OF_TESTCASES,
 };
