Package org.gradle.api.problems

## Interface Problems

-     @Incubating
      public interface Problems

  Problems API service.

  The main purpose of this API is to allow clients to create configure and report problems in a centralized way.

  Reported problems are exposed via build operation progress events, which then be converted to Tooling API progress events.

  Since:
    8.4

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `ReportableProblem` | `create​(ProblemBuilderSpec action)` | Configures a new problem.
    `java.lang.RuntimeException` | `rethrowing​(java.lang.RuntimeException e, ProblemBuilderSpec action)` | Configures a new problem with error severity using an existing exception as input, reports it and uses it to throw a new exception.
    `java.lang.RuntimeException` | `throwing​(ProblemBuilderSpec action)` | Configures a new problem with error severity, reports it and uses it to throw a new exception.

- - ### Method Detail

    - #### throwing

          java.lang.RuntimeException throwing​(ProblemBuilderSpec action)

      Configures a new problem with error severity, reports it and uses it to throw a new exception.

      Returns:
        nothing, the method throws an exception

    - #### rethrowing

          java.lang.RuntimeException rethrowing​(java.lang.RuntimeException e,
                                                ProblemBuilderSpec action)

      Configures a new problem with error severity using an existing exception as input, reports it and uses it to throw a new exception.

      Returns:
        nothing, the method throws an exception

    - #### create

          ReportableProblem create​(ProblemBuilderSpec action)

      Configures a new problem.

      The method uses a stepwise builder pattern in the provided `ProblemBuilderSpec`, forcing the clients to define all mandatory fields in a specific order.

      If all required fields are provided, the method creates and returns a new problem. Problems should be reported separately with `ReportableProblem.report()`.

      Returns:
        a new problem

      Since:
        8.5