Interface ErrorManager

All Superinterfaces:
ErrorHandler
All Known Implementing Classes:
AntErrorManager, BasicErrorManager, BlackHoleErrorManager, FixingErrorManager, LoggerErrorManager, PrintStreamErrorManager, SortingErrorManager, ThreadSafeDelegatingErrorManager

public interface ErrorManager extends ErrorHandler
The error manager is in charge of storing, organizing and displaying errors and warnings generated by the compiler.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    void
    Writes a report to an implementation-specific medium.
    int
    Gets the number of reported errors.
    com.google.common.collect.ImmutableList<JSError>
    Gets all the errors.
    double
    Gets the percentage of typed expressions.
    int
    Gets the number of reported warnings.
    com.google.common.collect.ImmutableList<JSError>
    Gets all the warnings.
    default boolean
    Returns if the error manager has errors that should make compilation halt.
    void
    report(CheckLevel level, JSError error)
    Reports an error.
    void
    setTypedPercent(double typedPercent)
    Sets the percentage of typed expressions.
    default boolean
    shouldReportConformanceViolation(com.google.javascript.jscomp.Requirement requirement, com.google.common.base.Optional<com.google.javascript.jscomp.Requirement.WhitelistEntry> whitelistEntry, JSError diagnostic)
    Return true if the conformance violation should be reported.
  • Method Details Link icon

    • report Link icon

      void report(CheckLevel level, JSError error)
      Reports an error. The errors will be displayed by the generateReport() at the discretion of the implementation.
      Specified by:
      report in interface ErrorHandler
      Parameters:
      level - the reporting level
      error - the error to report
    • generateReport Link icon

      void generateReport()
      Writes a report to an implementation-specific medium. The compiler calls this method after any and all report(com.google.javascript.jscomp.CheckLevel, com.google.javascript.jscomp.JSError) calls.
    • getErrorCount Link icon

      int getErrorCount()
      Gets the number of reported errors.
    • getWarningCount Link icon

      int getWarningCount()
      Gets the number of reported warnings.
    • getErrors Link icon

      com.google.common.collect.ImmutableList<JSError> getErrors()
      Gets all the errors.
    • getWarnings Link icon

      com.google.common.collect.ImmutableList<JSError> getWarnings()
      Gets all the warnings.
    • setTypedPercent Link icon

      void setTypedPercent(double typedPercent)
      Sets the percentage of typed expressions.
    • getTypedPercent Link icon

      double getTypedPercent()
      Gets the percentage of typed expressions.
    • hasHaltingErrors Link icon

      default boolean hasHaltingErrors()
      Returns if the error manager has errors that should make compilation halt. This, for example, omits errors that were promoted from warnings by using the --strict flag.
    • shouldReportConformanceViolation Link icon

      default boolean shouldReportConformanceViolation(com.google.javascript.jscomp.Requirement requirement, com.google.common.base.Optional<com.google.javascript.jscomp.Requirement.WhitelistEntry> whitelistEntry, JSError diagnostic)
      Return true if the conformance violation should be reported. This is called even if the violation is whitelisted.