本文整理匯總了Python中staticdata.manager.ErrorCodeManager.ErrorCodeManager.getError方法的典型用法代碼示例。如果您正苦於以下問題:Python ErrorCodeManager.getError方法的具體用法?Python ErrorCodeManager.getError怎麽用?Python ErrorCodeManager.getError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類staticdata.manager.ErrorCodeManager.ErrorCodeManager
的用法示例。
在下文中一共展示了ErrorCodeManager.getError方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: generalUpdate
# 需要導入模塊: from staticdata.manager.ErrorCodeManager import ErrorCodeManager [as 別名]
# 或者: from staticdata.manager.ErrorCodeManager.ErrorCodeManager import getError [as 別名]
def generalUpdate(data, request=None):
tb = MongoDatabase.findTableByMessageObj(data)
if tb:
tb.update(data)
else:
error = ErrorCodeManager.getError("ErrorDb_TableNotFound")
request.error(error.what, error.code)
return
if request:
request.response()
示例2: updateTFamilyMemberBatch
# 需要導入模塊: from staticdata.manager.ErrorCodeManager import ErrorCodeManager [as 別名]
# 或者: from staticdata.manager.ErrorCodeManager.ErrorCodeManager import getError [as 別名]
def updateTFamilyMemberBatch(self, familyMembers, _request):
"""
:type familyMembers: list[message.db.mongodb.usertables.TFamilyMember]
:type _request: ITableSaver_Updatetfamilymemberbatch_Request
"""
tb = MongoDatabase.findTableByMessageType(TFamilyMember)
if tb:
tb.update(familyMembers)
else:
error = ErrorCodeManager.getError("ErrorDb_TableNotFound")
_request.error(error.what, error.code)
return
_request.response()
示例3: loadSysTopics
# 需要導入模塊: from staticdata.manager.ErrorCodeManager import ErrorCodeManager [as 別名]
# 或者: from staticdata.manager.ErrorCodeManager.ErrorCodeManager import getError [as 別名]
def loadSysTopics(self, pageIndex, numPerPage, _request):
"""
:type pageIndex: int
:type numPerPage: int
:type _request: message.db.itablesaver.ITableSaver_Loadsystopics_Request
"""
Logger.log("Loading SysTopics request...")
tb = MongoDatabase.findTableByMessageType(TSysTopic)
if not tb:
error = ErrorCodeManager.getError("ErrorDb_TableNotFound")
_request.error(error.what, error.code)
return
skips = pageIndex * numPerPage
res = tb.findManyWithQuey({}, limit=numPerPage, skip=skips, sort=[("_id", -1)])
topicList = SeqTSysTopic()
topicList.extend(res)
_request.response(topicList)
示例4: removeFamilyMembers
# 需要導入模塊: from staticdata.manager.ErrorCodeManager import ErrorCodeManager [as 別名]
# 或者: from staticdata.manager.ErrorCodeManager.ErrorCodeManager import getError [as 別名]
def removeFamilyMembers(self, userId, indexes, _request):
"""
:type userId: str
:type indexes: list[int]
:type _request: ITableSaver_Removefamilymembers_Request
"""
tb = MongoDatabase.findTableByMessageType(TFamilyMember)
if not tb:
error = ErrorCodeManager.getError("ErrorDb_TableNotFound")
_request.error(error.what, error.code)
return
for index in indexes:
query = {TFamilyMember.fn_userId: userId, TFamilyMember.fn_index: index}
tb.delete(query, True)
_request.response()
示例5: generalError
# 需要導入模塊: from staticdata.manager.ErrorCodeManager import ErrorCodeManager [as 別名]
# 或者: from staticdata.manager.ErrorCodeManager.ErrorCodeManager import getError [as 別名]
def generalError(request, errorName):
error = ErrorCodeManager.getError("ErrorDb_TableNotFound")
request.error(error.what, error.code)
示例6: onTimeout
# 需要導入模塊: from staticdata.manager.ErrorCodeManager import ErrorCodeManager [as 別名]
# 或者: from staticdata.manager.ErrorCodeManager.ErrorCodeManager import getError [as 別名]
def onTimeout(self):
self.clientRequest.error(ErrorCodeManager.getError("ErrorLogin_signupOperTimeout"))