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
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