private String getUsefulMessageSummary() { if (isHamcrestException()) { return compressedHamcrestMessage(); } else { return extractFirstLine(); } }
/** * Returns the first line only of the error message. * This avoids polluting the UI with unnecessary details such as browser versions and so forth. * * @return */ public String getShortErrorMessage() { return escapedHtml((originalMessage.isPresent()) ? getUsefulMessageSummary() : ""); }
private String firstNonExceptionLineIn(String lines[]) { for(String candidateLine : lines) { String lineWithoutExceptions = removeLeadingExceptionFrom(candidateLine); if (StringUtils.isNotEmpty(lineWithoutExceptions)) { return lineWithoutExceptions; } } return ""; }
/** * Returns the first line only of the error message. * This avoids polluting the UI with unnecessary details such as browser versions and so forth. */ public String getShortErrorMessage() { return new ErrorMessageFormatter(getErrorMessage()).getShortErrorMessage(); }
private String extractFirstLine() { String lines[] = originalMessage.get().split("\\r?\\n"); return StringUtils.trimToEmpty(replaceDoubleQuotesIn(firstNonExceptionLineIn(lines))); }
public String getShortErrorMessage() { return new ErrorMessageFormatter(getErrorMessage()).getShortErrorMessage(); }
private String extractFirstLine() { String lines[] = originalMessage.get().split("\\r?\\n"); return StringUtils.trimToEmpty(replaceDoubleQuotesIn(firstNonExceptionLineIn(lines))); }
private String getUsefulMessageSummary() { if (isHamcrestException()) { return compressedHamcrestMessage(); } else { return extractFirstLine(); } }
/** * Returns the first line only of the error message. * This avoids polluting the UI with unnecessary details such as browser versions and so forth. * @return */ public String getShortErrorMessage() { return new ErrorMessageFormatter(getErrorMessage()).getShortErrorMessage(); }
/** * Returns the first line only of the error message. * This avoids polluting the UI with unnecessary details such as browser versions and so forth. */ public String getShortErrorMessage() { return escapedHtml((originalMessage.isPresent()) ? getUsefulMessageSummary() : ""); }
private String extractFirstLine() { String lines[] = originalMessage.get().split("\\r?\\n"); return StringUtils.trimToEmpty(replaceDoubleQuotesIn(firstNonExceptionLineIn(lines))); }
private String firstNonExceptionLineIn(String lines[]) { for(String candidateLine : lines) { String lineWithoutExceptions = removeLeadingExceptionFrom(candidateLine); if (StringUtils.isNotEmpty(lineWithoutExceptions)) { return lineWithoutExceptions; } } return ""; }
private String getUsefulMessageSummary() { if (isHamcrestException()) { return compressedHamcrestMessage(); } else { return extractFirstLine(); } }
/** * Returns the first line only of the error message. * This avoids polluting the UI with unnecessary details such as browser versions and so forth. */ public String getShortErrorMessage() { return new ErrorMessageFormatter(getErrorMessage()).getShortErrorMessage(); }
/** * Returns the first line only of the error message. * This avoids polluting the UI with unnecessary details such as browser versions and so forth. */ public String getShortErrorMessage() { return escapedHtml((originalMessage.isPresent()) ? getUsefulMessageSummary() : ""); }
private String firstNonExceptionLineIn(String lines[]) { for(String candidateLine : lines) { String lineWithoutExceptions = removeLeadingExceptionFrom(candidateLine); if (StringUtils.isNotEmpty(lineWithoutExceptions)) { return lineWithoutExceptions; } } return ""; }
public String getShortErrorMessage() { return new ErrorMessageFormatter(getErrorMessage()).getShortErrorMessage(); }
private String compressedHamcrestMessage() { String messageWithoutExceptions = removeLeadingExceptionFrom(originalMessage.get()); String words[] = StringUtils.split(messageWithoutExceptions); return StringUtils.join(words," "); }
public String getShortErrorMessage() { return new ErrorMessageFormatter(getErrorMessage()).getShortErrorMessage(); }
private String compressedHamcrestMessage() { String messageWithoutExceptions = removeLeadingExceptionFrom(originalMessage.get()); String words[] = StringUtils.split(messageWithoutExceptions); return StringUtils.join(words," "); }