           self.localizedMessageLogger.error("BazelInfoExtractionFailed",
                                             comment: "Error message for when a Bazel extractor did not complete successfully. Details are logged separately.",
                                             details: BazelErrorExtractor.firstErrorLinesFromString(debugInfo))
-        }
-      } catch let e {
+          throw ExtractorError.buildFailed
+        }
+      } catch let e as NSError {
         self.localizedMessageLogger.infoMessage(e.localizedDescription)
         self.localizedMessageLogger.error("BazelInfoExtractionFailed",
                                           comment: "Error message for when a Bazel extractor did not complete successfully. Details are logged separately.",
                                           details: "Failed to read all build events. See the error above.")
+        throw ExtractorError.buildFailed
       }
     }
     localizedMessageLogger.logProfilingEnd(profilingStart)

                                                               message: "Extracting info for \(targets.count) rules")

    let semaphore = DispatchSemaphore(value: 0)
    var extractedEntries = [BuildLabel: RuleEntry]()
    let process = bazelAspectProcessForTargets(targets.map({ $0.value }),
                                               aspect: "tulsi_sources_aspect",
                                               startupOptions: startupOptions,

      process.currentDirectoryPath = workspaceRootURL.path
      process.launch()
      _ = semaphore.wait(timeout: DispatchTime.distantFuture)
      guard process.terminationStatus == 0, !artifacts.isEmpty else {
        let debugInfo = processDebugInfo ?? "<No Debug Info>"
        localizedMessageLogger.infoMessage(debugInfo)
        localizedMessageLogger.error("BazelInfoExtractionFailed",
                                     comment: "Error message for when a Bazel extractor did not complete successfully. Details are logged separately.",
                                     details: BazelErrorExtractor.firstErrorLinesFromString(debugInfo))
        throw ExtractorError.buildFailed
      }
    }
    localizedMessageLogger.logProfilingEnd(profilingStart)
    return extractRuleEntriesFromArtifacts(artifacts, progressNotifier: progressNotifier)
  }

  // MARK: - Private methods
