本文整理汇总了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"))