Package org.gradle.api.problems
Interface ProblemReporter
Defines different ways to report problems.
- Since:
- 8.6
- 
Method SummaryModifier and TypeMethodDescriptioncreate(ProblemId problemId, Action<? super ProblemSpec> action) Creates a new problem without reporting it immediately.voidreport(Collection<? extends Problem> problems) Reports the target problems.voidReports the target problem.voidreport(ProblemId problemId, Action<? super ProblemSpec> spec) Configures and reports a new problem.throwing(Throwable exception, Collection<? extends Problem> problems) Reports the target problems and throws a runtime exception.Configures a new problem, reports it, and uses it to throw a new exception.throwing(Throwable exception, ProblemId problemId, Action<? super ProblemSpec> spec) Configures a new problem, reports it, and uses it to throw a new exception.
- 
Method Details- 
createCreates a new problem without reporting it immediately. The created problem can be later reported withreport(Problem).- Parameters:
- problemId- The problem id
- action- The problem configuration.
- Returns:
- The new problem.
- Since:
- 8.13
 
- 
reportConfigures and reports a new problem.The spec must specify the problem label and the category. Any additional configuration is optional. - Parameters:
- problemId- the problem id
- spec- the problem configuration
- Since:
- 8.13
 
- 
reportReports the target problem.- Parameters:
- problem- The problem to report.
- Since:
- 8.13
 
- 
reportReports the target problems.- Parameters:
- problems- The problems to report.
- Since:
- 8.13
 
- 
throwingRuntimeException throwing(Throwable exception, ProblemId problemId, Action<? super ProblemSpec> spec) Configures a new problem, reports it, and uses it to throw a new exception.An exception must be provided in the spec. The spec must specify the exception, the problem label, and the category. Any additional configuration is optional. - Parameters:
- exception- the exception to throw after reporting the problems
- problemId- the problem id
- spec- the problem configuration
- Returns:
- never returns by throwing the exception, but using throwstatement at the call site is encouraged to indicate the intent and benefit from local control flow.
- Since:
- 8.13
 
- 
throwingConfigures a new problem, reports it, and uses it to throw a new exception.An exception must be provided in the spec. The spec must specify the exception, the problem label, and the category. Any additional configuration is optional. - Parameters:
- exception- the exception to throw after reporting the problems
- problem- the problem to report
- Returns:
- never returns by throwing the exception, but using throwstatement at the call site is encouraged to indicate the intent and benefit from local control flow.
- Since:
- 8.13
 
- 
throwingReports the target problems and throws a runtime exception. When this method is used, all reported problems will be associated with the thrown exception.- Parameters:
- exception- the exception to throw after reporting the problems
- problems- the problems to report
- Returns:
- nothing, the method throws an exception
- Since:
- 8.13
 
 
-