本文整理汇总了Python中twisted.python.failure.Failure.value方法的典型用法代码示例。如果您正苦于以下问题:Python Failure.value方法的具体用法?Python Failure.value怎么用?Python Failure.value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted.python.failure.Failure
的用法示例。
在下文中一共展示了Failure.value方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parseError
# 需要导入模块: from twisted.python.failure import Failure [as 别名]
# 或者: from twisted.python.failure.Failure import value [as 别名]
def parseError(self, err, query, instMap):
err = Failure(err)
err.value = 'Received %s from query: %s'%(err.value, query)
log.error(err.getErrorMessage())
results = {}
for instances in instMap.values():
for tables in instances.values():
for table, props in tables:
results[table] = [err,]
return results
示例2: test_process_done
# 需要导入模块: from twisted.python.failure import Failure [as 别名]
# 或者: from twisted.python.failure.Failure import value [as 别名]
def test_process_done(self):
error = Failure(exc_value=Exception())
error.type = ProcessDone
error.value = Mock(exitCode=1, message="foobar")
jobtype = JobType(fake_assignment())
self.assertEqual(
jobtype.format_error(error),
"Process has finished with no apparent errors."
)
示例3: test_process_terminated
# 需要导入模块: from twisted.python.failure import Failure [as 别名]
# 或者: from twisted.python.failure.Failure import value [as 别名]
def test_process_terminated(self):
error = Failure(exc_value=Exception())
error.type = ProcessTerminated
error.value = Mock(exitCode=1, message="foobar")
jobtype = JobType(fake_assignment())
self.assertEqual(
jobtype.format_error(error),
"Process may have terminated abnormally, please check "
"the logs. Message from error "
"was 'foobar'"
)
示例4: parseError
# 需要导入模块: from twisted.python.failure import Failure [as 别名]
# 或者: from twisted.python.failure.Failure import value [as 别名]
def parseError(self, err, query, instMap):
if isinstance(err.value, pywbem.cim_http.AuthError):
msg = 'AuthError: Please check zWinUser and zWinPassword zProperties'
else:
msg = 'Received %s from query: %s'%(err.value[1], query)
err = Failure(err)
err.value = msg
log.error(err.getErrorMessage())
results = {}
for instances in instMap.values():
for tables in instances.values():
for table, props in tables:
results[table] = [err]
return results