Skip to content

Commit

Permalink
Print stack trace as string if the processing of config metadata fails
Browse files Browse the repository at this point in the history
  • Loading branch information
arouel committed Oct 4, 2024
1 parent ad09e8d commit c0bf510
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashSet;
Expand Down Expand Up @@ -93,9 +94,11 @@ boolean process(RoundEnvironment roundEnv) {
try {
return doProcess(roundEnv);
} catch (Exception e) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
messager.printMessage(Diagnostic.Kind.ERROR, "Failed to process config metadata annotation processor. "
+ toMessage(e));
e.printStackTrace();
+ sw);
return false;
}
}
Expand Down

0 comments on commit c0bf510

Please sign in to comment.