本文整理汇总了Java中com.google.iosched.model.DataCheck.CheckFailure类的典型用法代码示例。如果您正苦于以下问题:Java CheckFailure类的具体用法?Java CheckFailure怎么用?Java CheckFailure使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CheckFailure类属于com.google.iosched.model.DataCheck包,在下文中一共展示了CheckFailure类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: reportDataCheckFailures
import com.google.iosched.model.DataCheck.CheckFailure; //导入依赖的package包/类
private void reportDataCheckFailures(CheckResult result, OutputStream optionalOutput) throws IOException {
StringBuilder errorMessage = new StringBuilder();
errorMessage.append(
"\nHey,\n\n"
+ "(this message is autogenerated)\n"
+ "The iosched data updater ran but found some inconsistent data.\n"
+ "Please, check the messages below and fix the sources. "
+ "\n\n" + result.failures.size() + " data non-compliances:\n");
for (CheckFailure f: result.failures) {
errorMessage.append(f).append("\n\n");
}
if (SystemProperty.environment.value() != SystemProperty.Environment.Value.Development ||
optionalOutput == null) {
// send email if user is not running in dev or interactive mode (show=true)
Message message = new Message();
message.setSender(Config.EMAIL_TO_SEND_UPDATE_ERRORS);
message.setSubject("[iosched-data-error] Updater - Inconsistent data");
message.setTextBody(errorMessage.toString());
MailServiceFactory.getMailService().sendToAdmins(message);
} else {
// dump errors to optionalOutput
optionalOutput.write(errorMessage.toString().getBytes());
}
}