@Incubating public interface Problems
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.
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.
|
ProblemBuilderDefiningLabel createProblemBuilder()
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()
.
java.lang.RuntimeException throwing(ProblemBuilderSpec action)
Note: The action should not call the build()
method on the builder.
java.lang.RuntimeException rethrowing(java.lang.RuntimeException e, ProblemBuilderSpec action)
Note: The action should not call the build()
method on the builder.