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 51f95b9 commit 3fe941e
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2023 Oracle and/or its affiliates.
* Copyright (c) 2021, 2024 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -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 @@ -92,9 +93,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 3fe941e

Please sign in to comment.