GENICLOUD-16
[sfa.git] / sfa / server / modpythonapi / ApiExceptions.py
1 import traceback
2 import xmlrpclib
3
4 FAULTCODE = 900
5
6 class UnhandledServerException(xmlrpclib.Fault):
7     def __init__(self, type, value, tb):
8         exc_str = ''.join(traceback.format_exception(type, value, tb))
9         faultString = exc_str # "Unhandled exception: " + str(type) + "\n" + exc_str
10         xmlrpclib.Fault.__init__(self, FAULTCODE + 1, faultString)
11
12 class BadRequestHash(xmlrpclib.Fault):    
13    def __init__(self, hash = None):
14         faultString = "bad request hash: " + str(hash)
15         xmlrpclib.Fault.__init__(self, FAULTCODE + 2, faultString)