2014-07-01 06:45:00 +00:00
|
|
|
__author__ = 'tanshu'
|
|
|
|
|
|
|
|
|
|
|
|
class ValidationError(Exception):
|
2014-07-29 07:52:10 +00:00
|
|
|
def __init__(self, message, Errors=None):
|
2014-07-01 06:45:00 +00:00
|
|
|
self.message = message
|
|
|
|
# Call the base class constructor with the parameters it needs
|
2014-07-29 07:52:10 +00:00
|
|
|
Exception.__init__(self, message)
|
2014-07-01 06:45:00 +00:00
|
|
|
|
|
|
|
# Now for your custom code...
|
|
|
|
self.Errors = Errors
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return self.message
|
|
|
|
|
|
|
|
def json(self):
|
2014-07-29 07:52:10 +00:00
|
|
|
return self.message
|