@Override
  public Optional<ReadError> read(DbFileSources.Line.Builder lineBuilder) {
    if (readError == null) {
      try {
        processHighlightings(lineBuilder);
      } catch (RangeOffsetConverterException e) {
        readError = new ReadError(HIGHLIGHTING, lineBuilder.getLine());
        LOG.debug(format("Inconsistency detected in Highlighting data. Highlighting will be ignored for file '%s'", file.getKey()), e);
      }
    }
    return Optional.ofNullable(readError);
  }
@Test
  public void not_fail_and_stop_processing_when_range_offset_converter_throw_RangeOffsetConverterException() {
    TextRange textRange1 = newTextRange(LINE_1, LINE_1);
    doThrow(RangeOffsetConverterException.class).when(rangeOffsetConverter).offsetToString(textRange1, LINE_1, DEFAULT_LINE_LENGTH);

    HighlightingLineReader highlightingLineReader = newReader(of(
      textRange1, HighlightingType.ANNOTATION,
      newSingleLineTextRangeWithExpectingLabel(LINE_2, RANGE_LABEL_1), HIGHLIGHTING_STRING));

    LineReader.ReadError readErrorLine1 = new LineReader.ReadError(HIGHLIGHTING, LINE_1);
    assertThat(highlightingLineReader.read(line1)).contains(readErrorLine1);
    assertThat(highlightingLineReader.read(line2)).contains(readErrorLine1);

    assertNoHighlighting();
    assertThat(logTester.logs(DEBUG)).isNotEmpty();
  }