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
    --- | --- | ---
    `ProblemBuilderDefiningLabel` | `createProblemBuilder()` | Returns a new problem builder which can configure and create Problem instances.
    `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

    - #### createProblemBuilder

          ProblemBuilderDefiningLabel createProblemBuilder()

      Returns a new problem builder which can configure and create Problem instances.

      The builder uses a stepwise builder pattern forcing the clients to define all mandatory fields in a specific order.

      Once all mandatory fields are set, the returned type will allow clients to call `ProblemBuilder.build()` to create a new Problem instance. The `ProblemBuilder.build()` method doesn't have any side effects, it just creates a new instance. Problems should be reported separately with `ReportableProblem.report()`.

      Returns:
        a new problem builder

    - #### throwing

          java.lang.RuntimeException throwing​(ProblemBuilderSpec action)

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

      Note: The action should not call the `build()` method on the builder.

      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.

      Note: The action should not call the `build()` method on the builder.

      Returns:
        nothing, the method throws an exception