Commit 887fdf6f authored by Ilias Tsitsimpis's avatar Ilias Tsitsimpis
Browse files

snf-django-lib: Fault Exceptions now have code attr

parent 564eb947
...@@ -40,11 +40,13 @@ def camel_case(s): ...@@ -40,11 +40,13 @@ def camel_case(s):
class Fault(Exception): class Fault(Exception):
def __init__(self, message='', details='', name=''): def __init__(self, message='', details='', name='', code=None):
Exception.__init__(self, message, details, name)
self.message = message self.message = message
self.details = details self.details = details
if not hasattr(self, 'code'):
self.code = code
self.name = name or camel_case(self.__class__.__name__) self.name = name or camel_case(self.__class__.__name__)
Exception.__init__(self, message, details, self.name, self.code)
# 2xx # 2xx
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment