WillemJiang commented on a change in pull request #9: SCB-1383 support toolkit
maven plugin commands that generating code
URL: https://github.com/apache/servicecomb-toolkit/pull/9#discussion_r307572589
##########
File path:
toolkit-maven-plugin/src/main/java/org/apache/servicecomb/toolkit/plugin/GenerateUtil.java
##########
@@ -57,16 +58,17 @@ public static void generateContract(MavenProject project,
String contractOutput,
// TODO: support users to add other getGenerator type soon
ContractsGenerator contractGenerator =
GeneratorFactory.getGenerator(ContractsGenerator.class, type);
Objects.requireNonNull(contractGenerator).configure(contractConfig);
- contractGenerator.generate();
+ if (!contractGenerator.generate()) {
+ throw new RuntimeException("failed to generate contract by generator " +
type);
+ }
}
- public static void generateDocument(String contractLocation, String
documentOutput, String type)
- throws IOException {
+ public static void generateDocument(String contractLocation, String
documentOutput, String type) throws IOException {
// TODO: support users to add other getGenerator type soon
DocGenerator docGenerator =
GeneratorFactory.getGenerator(DocGenerator.class, type);
if (docGenerator == null) {
- throw new RuntimeException("DocGenerator's implementation is not found");
+ throw new RuntimeException("not found document generator's
implementation");
Review comment:
"Cannot xxx"
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services