Formats this error along with other errors that are mergeable with this error. mergeableErrors is a list that contains all other errors that are reported in the same exception that are considered to be mergable with this error base on result of calling #isMergeable. The list will
(int index, List<ErrorDetail<?>> mergeableErrors, Formatter formatter)
| 59 | * @param formatter for printing the error message |
| 60 | */ |
| 61 | public final void format(int index, List<ErrorDetail<?>> mergeableErrors, Formatter formatter) { |
| 62 | String id = getErrorIdentifier().map(s -> "[" + Messages.redBold(s) + "]: ").orElse(""); |
| 63 | formatter.format("%s) %s%s\n", index, id, getMessage()); |
| 64 | formatDetail(mergeableErrors, formatter); |
| 65 | // TODO(b/151482394): Output potiential fixes for the error |
| 66 | Optional<String> learnMoreLink = getLearnMoreLink(); |
| 67 | if (learnMoreLink.isPresent()) { |
| 68 | formatter.format("\n%s\n", Messages.bold("Learn more:")); |
| 69 | formatter.format(" %s\n", Messages.underline(learnMoreLink.get())); |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Formats the detail of this error message along with other errors that are mergeable with this |
no test coverage detected