@Override
  public DetectionReportList detect(
      TargetInfo target, ImmutableList<NetworkService> matchedServices) {
    try {
      if (checkHealthWithBackoffs()) {
        var runRequest =
            RunRequest.newBuilder().setTarget(target).addAllPlugins(pluginsToRun).build();
        logger.atInfo().log("Detecting with language server plugins...");
        RunResponse runResponse;
        if (this.wantCompactRunRequest) {
          var runCompactRequest = CompactRunRequestHelper.compress(runRequest);
          runResponse = service.runCompactWithDeadline(runCompactRequest, deadline).get();
        } else {
          runResponse = service.runWithDeadline(runRequest, deadline).get();
        }
        return runResponse.getReports();
      }
    } catch (InterruptedException | ExecutionException e) {
      throw new LanguageServerException("Failed to get response from language server.", e);
    }
    return DetectionReportList.getDefaultInstance();
  }
@Test(timeout = 30000L)
  public void detect_withRpcError_throwsLanguageServerException() throws Exception {
    registerHealthCheckWithError();

    assertThrows(
        LanguageServerException.class,
        () ->
            getNewRemoteVulnDetectorInstance()
                .detect(TargetInfo.getDefaultInstance(), ImmutableList.of()));
  }