def wrapper(*args,**kwargs): try: return func(*args,**kwargs) except Exception as e: Logger.getlogger("view").error("exception occurred within "+func.__name__) Logger.getlogger("view").error(str(e)) return HttpResponse( AIResponse(error=AIError(AIError.SYSTEM)).serialize() )
def create(self): try: # connect to db SerialDoc.connectdb() # save self.save() return self except Exception as e: Logger.getlogger("doc").error(e) return None
def create(self): try: #status self.status=MLCase.STATUS_DRAFT #uuid self.uuid=MLCase._get_guid() #connect to db SerialDoc.connectdb() #save self.save() return self except Exception as e: Logger.getlogger("test").info(e) return None
def rpccall(self,cmd,*args): #host host=Config.matcher_controller_host port=Config.matcher_controller_port try: #connect proxy=xmlrpclib.ServerProxy("http://"+host+":"+str(port)+"/") #get method method=getattr(proxy,cmd,None) #make call resp=method(*args) return resp except Exception as e: Logger.getlogger("app").info(e) return None
def __init__(self,request): super(AuthMgr,self).__init__(request) self.logger=Logger.getlogger(self.__class__.__name__)