Skip to content

Commit

Permalink
Add more information to error message when @AggregatedDeps annotation…
Browse files Browse the repository at this point in the history
… is missing.

Users should never actually hit this error but we've seen some reports where a user hit this in #4362, so I've added information about the failing element to help the user further narrow down the issue.

RELNOTES=N/A
PiperOrigin-RevId: 658923031
  • Loading branch information
bcorso authored and Dagger Team committed Aug 2, 2024
1 parent da92d19 commit 3e0d349
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,11 @@ public static AggregatedDepsIr toIr(AggregatedDepsMetadata metadata) {
}

private static AggregatedDepsMetadata create(XTypeElement element, XProcessingEnv env) {
checkState(
element.hasAnnotation(ClassNames.AGGREGATED_DEPS),
"Missing @AggregatedDeps annotation on %s",
element.getClassName().canonicalName());
XAnnotation annotation = element.getAnnotation(ClassNames.AGGREGATED_DEPS);

return new AutoValue_AggregatedDepsMetadata(
element,
getTestElement(annotation.getAnnotationValue("test"), env),
Expand Down

0 comments on commit 3e0d349

Please sign in to comment.