[Kimchi-devel] [PATCH] [Wok 1/3] Update WokException to store code and args

Lucio Correia luciojhc at linux.vnet.ibm.com
Tue Aug 9 19:15:25 UTC 2016


Signed-off-by: Lucio Correia <luciojhc at linux.vnet.ibm.com>
---
 src/wok/exception.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/wok/exception.py b/src/wok/exception.py
index f8f4bd4..3e8e058 100644
--- a/src/wok/exception.py
+++ b/src/wok/exception.py
@@ -30,6 +30,7 @@ class WokException(Exception):
             args = {}
         self.httpStatusCode = 500
         self.code = code
+        self.params = args
         msg = WokMessage(code, args).get_text()
         cherrypy.log.error_log.error(msg)
         Exception.__init__(self, msg)
@@ -37,6 +38,12 @@ class WokException(Exception):
     def getHttpStatusCode(self):
         return self.httpStatusCode
 
+    def getCode(self):
+        return self.code
+
+    def getParams(self):
+        return self.params
+
 
 class NotFoundError(WokException):
     def __init__(self, code='', args=None):
-- 
1.9.1




More information about the Kimchi-devel mailing list