示例#1
0
文件: error.py 项目: pepribas/F3AT
def get_failure_message(failure):
    try:
        msg = xlog.getFailureMessage(failure)
    except KeyError:
        # Sometime happen for strange error, just when we relly need a message
        msg = failure.getErrorMessage()
    exception = failure.value
    if isinstance(exception, FeatError):
        details = exception.cause_details
        if details:
            msg += "; CAUSED BY " + details
    return msg
示例#2
0
文件: error.py 项目: zaheerm/feat
def get_failure_message(failure):
    try:
        msg = xlog.getFailureMessage(failure)
    except KeyError:
        # Sometime happen for strange error, just when we realy need a message
        error_type = failure.type
        if isinstance(error_type, types.TypeType):
            error_type = error_type.__name__
        msg = "%s %s" % (error_type, failure.getErrorMessage())
    exception = failure.value
    if isinstance(exception, FeatError):
        details = exception.cause_details
        if details:
            msg += "; CAUSED BY " + details
    return msg