getProcessor static method

ErrorProcessor? getProcessor(
  1. AnalysisOptions? analysisOptions,
  2. AnalysisError error
)

Returns an error processor associated in the analysisOptions for the given error, or null if none is found.

Implementation

static ErrorProcessor? getProcessor(
  // TODO(srawlins): Make `analysisOptions` non-nullable, in a breaking
  // change release.
  AnalysisOptions? analysisOptions,
  AnalysisError error,
) {
  return analysisOptions?.errorProcessors
      .firstWhereOrNull((processor) => processor.appliesTo(error));
}